diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2015-10-25 22:52:30 +0100 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-10-26 23:57:51 +0000 |
commit | 1ea43c26e68d92838a7d91dce4fe9686b09f12c7 (patch) | |
tree | 65c8b3f84f589530b16fc6159974f1813aa8968d /ui/qt/lbm_uimflow_dialog.cpp | |
parent | d141562efb18f777c122405941bd5ef8c21513b1 (diff) |
Only store frame number and not a pointer to frame_data structure in seq_analysis_item_t
Qt GUI allows to keep windows open after closing the capture file. Let's not access to freed memory.
Bug: 11573
Change-Id: I9e70d818a4b228af319961ec512b6b9725792477
Reviewed-on: https://code.wireshark.org/review/11270
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/lbm_uimflow_dialog.cpp')
-rw-r--r-- | ui/qt/lbm_uimflow_dialog.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/qt/lbm_uimflow_dialog.cpp b/ui/qt/lbm_uimflow_dialog.cpp index 01ee8477b3..c166a43fb4 100644 --- a/ui/qt/lbm_uimflow_dialog.cpp +++ b/ui/qt/lbm_uimflow_dialog.cpp @@ -125,7 +125,7 @@ static gboolean lbm_uimflow_add_to_graph(seq_analysis_info_t * seq_info, packet_ item = (seq_analysis_item_t *)g_malloc0(sizeof(seq_analysis_item_t)); copy_address(&(item->src_addr), &(pinfo->src)); copy_address(&(item->dst_addr), &(pinfo->dst)); - item->fd = pinfo->fd; + item->frame_number = pinfo->fd->num; item->port_src = pinfo->srcport; item->port_dst = pinfo->destport; item->protocol = g_strdup(port_type_to_str(pinfo->ptype)); @@ -191,7 +191,7 @@ static void lbm_uimflow_get_analysis(capture_file * cfile, seq_analysis_info_t * while (list != NULL) { seq_analysis_item_t * seq_item = (seq_analysis_item_t *)list->data; - set_fd_time(cfile->epan, seq_item->fd, time_str); + set_fd_time(cfile->epan, frame_data_sequence_find(cfile->frames, seq_item->frame_number), time_str); seq_item->time_str = g_strdup(time_str); list = g_list_next(list); } @@ -422,7 +422,7 @@ void LBMUIMFlowDialog::mouseMoved(QMouseEvent * event) seq_analysis_item_t * sai = m_sequence_diagram->itemForPosY(event->pos().y()); if (sai) { - m_packet_num = sai->fd->num; + m_packet_num = sai->frame_number; hint = QString("Packet %1: %2").arg(m_packet_num).arg(sai->comment); } } |