aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/main_window_slots.cpp
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2018-05-21 22:33:37 +0200
committerAnders Broman <a.broman58@gmail.com>2018-05-25 12:49:50 +0000
commitb078310bd0daf7cf8ba6df765cba9fcd98713dd8 (patch)
tree35067732a5b84187d7db9ef056a65c852783114b /ui/qt/main_window_slots.cpp
parent0bfdb0f72b459ca4281cbe8e9a673c57bd812e12 (diff)
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@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/qt/main_window_slots.cpp')
-rw-r--r--ui/qt/main_window_slots.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index 703c75b540..5ffed4b0a5 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -2109,8 +2109,10 @@ void MainWindow::on_actionStatisticsHpfeeds_triggered()
void MainWindow::on_actionFilePrint_triggered()
{
- PrintDialog pdlg(this, capture_file_.capFile());
+ capture_file *cf = capture_file_.capFile();
+ g_return_if_fail(cf);
+ PrintDialog pdlg(this, cf);
pdlg.exec();
}