Wireshark-commits: [Wireshark-commits] master-2.6 25d0ea6: Qt: fix use-after-free on error while sa
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=25d0ea64766c0622f2e1003745d51bbbb97c8ded
Submitter: Peter Wu (peter@xxxxxxxxxxxxx)
Changed: branch: master-2.6
Repository: wireshark
Commits:
25d0ea6 by Peter Wu (peter@xxxxxxxxxxxxx):
Qt: fix use-after-free on error while saving exported packets
When an error occurs while saving packets using the Export Specified
Packets dialog (e.g. try to overwrite the opened capture file), the
dialog is displayed again. As PacketRangeGroupBox freed the packet
selection range, a crash (use-after-free) occurs.
Removes some unnecessary code in MainWindow::exportDissections as well.
Change-Id: I63898427eff7e71799d89c8a22246db8f93a9ff6
Fixes: v2.5.0rc0-968-g38b40acb2d ("Qt: fix a memory leak when exporting packets")
Reviewed-on: https://code.wireshark.org/review/27695
Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@xxxxxxxxxxxxx>
Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
(cherry picked from commit b078310bd0daf7cf8ba6df765cba9fcd98713dd8)
Reviewed-on: https://code.wireshark.org/review/27813
Reviewed-by: Peter Wu <peter@xxxxxxxxxxxxx>
Actions performed:
from 37d1cf1 smb: fix wrong exported smb2 object due to hash collision
adds 25d0ea6 Qt: fix use-after-free on error while saving exported packets
Summary of changes:
file.c | 1 +
ui/packet_range.c | 4 ++++
ui/packet_range.h | 3 +++
ui/qt/export_dissection_dialog.cpp | 1 +
ui/qt/main_window.cpp | 23 +++++++++--------------
ui/qt/main_window_slots.cpp | 4 +++-
ui/qt/packet_range_group_box.cpp | 2 --
ui/qt/packet_range_group_box.h | 4 ++++
ui/qt/print_dialog.cpp | 3 ++-
9 files changed, 27 insertions(+), 18 deletions(-)