Qt: Show the correct data in the packet dialog.

Set our pointers and copy our data *after* we read our packet.

Bug: 12556
Change-Id: I5b373f94ad5b2fa2e6563142200a80912e717a96
Reviewed-on: https://code.wireshark.org/review/16211
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
This commit is contained in:
Gerald Combs 2016-06-29 16:12:12 -07:00 committed by Jaap Keuter
parent e55eaf573b
commit 37c928f28d
1 changed files with 2 additions and 1 deletions

View File

@ -52,10 +52,11 @@ PacketDialog::PacketDialog(QWidget &parent, CaptureFile &cf, frame_data *fdata)
setWindowSubtitle(tr("Packet %1").arg(fdata->num));
if (!cf_read_record(cap_file_.capFile(), fdata)) reject();
phdr_ = cap_file_.capFile()->phdr;
packet_data_ = (guint8 *) g_memdup(ws_buffer_start_ptr(&(cap_file_.capFile()->buf)), fdata->cap_len);
if (!cf_read_record(cap_file_.capFile(), fdata)) reject();
/* proto tree, visible. We need a proto tree if there's custom columns */
epan_dissect_init(&edt_, cap_file_.capFile()->epan, TRUE, TRUE);
col_custom_prime_edt(&edt_, &(cap_file_.capFile()->cinfo));