diff options
author | David Ameiss <dameiss@29west.com> | 2014-02-08 12:37:41 +0100 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-02-11 18:11:04 +0000 |
commit | d49485e191b9203d1c52b7e62e06f1d768342b62 (patch) | |
tree | 64083ac867672c553612ec42e3ae9e6f2a267fc9 /ui/qt/sequence_dialog.cpp | |
parent | 5e3113e7c96c515d70288cdb5b44e0ebdc5b5711 (diff) | |
download | wireshark-d49485e191b9203d1c52b7e62e06f1d768342b62.tar.gz |
Statistics->Flow Graph in qtshark crashes with a segfault
What appears to be happening is SequenceDiagram::draw() is iterating over the stored seq_analysis_item_t elements - but at the same time SequenceDialog::fillDiagram() is running - which destroys the old seq_analysis_info_t (which SequenceDiagram has stored a copy of and is referencing items in the list) then reloads it.
I'll attach a patch to SequenceDialog::fillDiagram() which fixes the problem - essentially calling sequence_analysis_list_get() with a new seq_analysis_info_t, calling SequenceDialog::setData() with the new one, then destroying the current seq_analysis_info_t and replacing it with the new on
Change-Id: I14f7b5dc64018ba5b81fe8d874a701e021401859
Closed-bug:9506
Reviewed-on: https://code.wireshark.org/review/175
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'ui/qt/sequence_dialog.cpp')
-rw-r--r-- | ui/qt/sequence_dialog.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/ui/qt/sequence_dialog.cpp b/ui/qt/sequence_dialog.cpp index f814e1c5bd..3589765018 100644 --- a/ui/qt/sequence_dialog.cpp +++ b/ui/qt/sequence_dialog.cpp @@ -345,12 +345,17 @@ void SequenceDialog::on_buttonBox_accepted() void SequenceDialog::fillDiagram() { QCustomPlot *sp = ui->sequencePlot; - + seq_analysis_info_t new_sa; + + new_sa = seq_analysis_; + new_sa.list = NULL; + new_sa.ht = NULL; + new_sa.num_nodes = 0; + sequence_analysis_list_get(cap_file_, &new_sa); + num_items_ = sequence_analysis_get_nodes(&new_sa); + seq_diagram_->setData(&new_sa); sequence_analysis_list_free(&seq_analysis_); - sequence_analysis_list_get(cap_file_, &seq_analysis_); - num_items_ = sequence_analysis_get_nodes(&seq_analysis_); - - seq_diagram_->setData(&seq_analysis_); + seq_analysis_ = new_sa; QFontMetrics vfm = QFontMetrics(sp->xAxis2->labelFont()); node_label_w_ = 0; |