wireshark/ui/qt/utils
Martin Kaiser 759fb119a7 FrameInformation: fix a crash in the destructor
It's possible to create a FrameInformation object that's not backed by
any frame data. In this case, fi_ is NULL and loadFrameTree() does not
run a dissection. However, we run epan_dissect_cleanup() unconditionally
in the destructor, even if edt_ is uninitialized. This causes a crash
when wireshark is closed.

Convert edt_ into a pointer. Run the cleanup only if we ran the
dissection before.

The issue can be reproduced by applying a display filter that makes the
list of the packets smaller than the packet list window. Right click
onto an "empty" part of the packet list and select "Mark/Unmark Frame".
Exiting wireshark at this point causes a segmentation fault

Thread 1 "wireshark" received signal SIGSEGV, Segmentation fault.
tvb_free_chain (tvb=0xf000e000d000c) at ../epan/tvbuff.c:124
124			tvb_free_internal(tvb);
(gdb) bt
 #0  tvb_free_chain (tvb=0xf000e000d000c) at ../epan/tvbuff.c:124
 #1  0x00007ffff430491e in epan_dissect_cleanup (edt=0x555558075b48) at ../epan/epan.c:648
 #2  0x00005555558fa5a6 in FrameInformation::~FrameInformation (this=0x555558075b20,
         __in_chrg=<optimized out>) at ../ui/qt/utils/frame_information.cpp:57
 #3  0x00005555558fa5e9 in FrameInformation::~FrameInformation (this=0x555558075b20,
         __in_chrg=<optimized out>) at ../ui/qt/utils/frame_information.cpp:55
 ...
 #12 0x00005555559a74f7 in PacketList::~PacketList (this=0x55555602e930,
         __in_chrg=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:1130

Change-Id: I347dd4901b4e08c37008ff25ac1f20a67555d9fd
Reviewed-on: https://code.wireshark.org/review/36825
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-15 14:27:39 +00:00
..
color_utils.cpp Qt: Update ColorUtils::themeLinkBrush. 2019-11-18 21:23:51 +00:00
color_utils.h Qt: Use a lighter link color in dark mode. 2019-06-25 20:31:41 +00:00
data_printer.cpp Qt: Cleanup space inside parentheses 2019-11-17 20:43:10 +00:00
data_printer.h Qt: Fix copy ASCII characters from ByteView 2019-01-08 16:21:41 +00:00
field_information.cpp Qt: Cleanup space inside parentheses 2019-11-17 20:43:10 +00:00
field_information.h replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later. 2018-02-08 14:57:36 +00:00
frame_information.cpp FrameInformation: fix a crash in the destructor 2020-04-15 14:27:39 +00:00
frame_information.h FrameInformation: fix a crash in the destructor 2020-04-15 14:27:39 +00:00
idata_printable.h replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later. 2018-02-08 14:57:36 +00:00
proto_node.cpp Qt: Cleanup space inside parentheses 2019-11-17 20:43:10 +00:00
proto_node.h replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later. 2018-02-08 14:57:36 +00:00
qt_ui_utils.cpp Qt: Suppress warning: unused parameter 'actions' 2020-01-14 06:33:49 +00:00
qt_ui_utils.h Qt: Make sure shortcuts are visible in context menus. 2020-01-13 18:58:28 +00:00
stock_icon.cpp HTTPS In More Places, update some URLs. 2019-07-27 07:55:36 +00:00
stock_icon.h Fix comment end after SPDX identifier 2018-05-01 06:56:37 +00:00
tango_colors.h Fix comment end after SPDX identifier 2018-05-01 06:56:37 +00:00
variant_pointer.h Fix comment end after SPDX identifier 2018-05-01 06:56:37 +00:00
wireshark_mime_data.cpp Qt: Remove DisplayFilterMimeData 2019-11-04 11:39:48 +00:00
wireshark_mime_data.h Qt: Remove DisplayFilterMimeData 2019-11-04 11:39:48 +00:00
wireshark_zip_helper.cpp Qt: Fix profile zip import on Windows 2020-02-29 10:15:29 +00:00
wireshark_zip_helper.h De-camel-ize "Wireshark" in a few places. 2019-12-18 04:31:03 +00:00