Wireshark-commits: [Wireshark-commits] master b078310: Qt: fix use-after-free on error while saving

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Fri, 25 May 2018 12:50:03 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=b078310bd0daf7cf8ba6df765cba9fcd98713dd8
Submitter: Anders Broman (a.broman58@xxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

b078310 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>
    

Actions performed:

    from  0bfdb0f   PAPI: Add new type for WebCC
    adds  b078310   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(-)