Fix for:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 20 Sep 2009 08:22:00 +0000 (08:22 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 20 Sep 2009 08:22:00 +0000 (08:22 +0000)
Columns Lazy initialization clobbers cinfo packet buffer. Open a file, goto packet 1000, menu View->Show packet in a new window, the wrong packet is decoded (it's the last displayed in the packet list pane). gtk/packet_win.c:new_window_cb() should call wtap_seek_reread().

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29997 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/packet_win.c

index 7a8a6a8a5bb9c40d6879cd593cc038768c3356d2..a77a650ca85a851c712be8877709e9753bc40c3e 100644 (file)
@@ -130,6 +130,16 @@ void new_window_cb(GtkWidget *w _U_)
                       *bv_nb_ptr;
   struct PacketWinData *DataPtr;
   int i;
+  int err;
+  gchar *err_info;
+
+  /* With the new packetlists "lazy columns" it's neccesary to reread the frame */
+  if (!wtap_seek_read(cfile.wth, cfile.current_frame->file_off, &cfile.pseudo_header,
+               cfile.pd, cfile.current_frame->cap_len, &err, &err_info)) {
+                       simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
+                       cf_read_error_message(err, err_info), cfile.filename);
+                       return;
+  }
 
   /* Allocate data structure to represent this window. */
   DataPtr = (struct PacketWinData *) g_malloc(sizeof(struct PacketWinData));