qt: fix crash on Search Packet while redissecting
authorPeter Wu <peter@lekensteyn.nl>
Thu, 25 Aug 2016 16:03:35 +0000 (18:03 +0200)
committerPeter Wu <peter@lekensteyn.nl>
Fri, 26 Aug 2016 08:59:11 +0000 (08:59 +0000)
Before redissection, PacketList::freeze() is called which clears the
model. This results in a NULL-deref when pressing Ctrl-F (Packet
Search) or Ctrl-G (Go To Packet). Reproducer: in a large capture file,
enter some display filter (e.g. "udp") and immediately press Ctrl-F.

Thanks to Github user SNAPESNATCH for the initial report via IRC that
included a helpful stack trace on Windows.

Change-Id: If7334d6df4e9591fb1f2a52e3e2f837285b2959f
Reviewed-on: https://code.wireshark.org/review/17326
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
ui/qt/main_window_slots.cpp

index 7bbdf11ba6975fc7d3df8728e17e70e682a7ba60..6a06b0a888c042b98dbae8489184c8eaad38f43e 100644 (file)
@@ -2003,7 +2003,7 @@ void MainWindow::on_actionEditCopyAsFilter_triggered()
 
 void MainWindow::on_actionEditFindPacket_triggered()
 {
-    if (packet_list_->model()->rowCount() < 1) {
+    if (packet_list_->packetListModel()->rowCount() < 1) {
         return;
     }
     previous_focus_ = wsApp->focusWidget();
@@ -3428,7 +3428,7 @@ void MainWindow::on_actionHelpAbout_triggered()
 }
 
 void MainWindow::on_actionGoGoToPacket_triggered() {
-    if (packet_list_->model()->rowCount() < 1) {
+    if (packet_list_->packetListModel()->rowCount() < 1) {
         return;
     }
     previous_focus_ = wsApp->focusWidget();