aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2015-09-29 23:27:01 +0200
committerGerald Combs <gerald@wireshark.org>2015-09-29 23:58:35 +0000
commit737e2d7800e450d8d3980aba0472101bd05dbd16 (patch)
tree00a63f6cb03ff17662e9fe073e936352aa2896bd /file.c
parentc2f0cd5144f3f119eb9a612ba15003ac49a03536 (diff)
file.c: do not rescan packets is no capture file is opened
Otherwise we will end up calling cf_cb_file_rescan_started and cf_cb_file_rescan_finished callbacks while no capture file is available Bug: 11552 Change-Id: Ib6fd7b13ce1b083d5f5b4e05d80152112c1451f6 Reviewed-on: https://code.wireshark.org/review/10692 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> 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 'file.c')
-rw-r--r--file.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/file.c b/file.c
index fdbd4073e4..c97194f6e9 100644
--- a/file.c
+++ b/file.c
@@ -1471,10 +1471,12 @@ cf_filter_packets(capture_file *cf, gchar *dftext, gboolean force)
/* Now rescan the packet list, applying the new filter, but not
throwing away information constructed on a previous pass. */
- if (dftext == NULL) {
- rescan_packets(cf, "Resetting", "Filter", FALSE);
- } else {
- rescan_packets(cf, "Filtering", dftext, FALSE);
+ if (cf->state != FILE_CLOSED) {
+ if (dftext == NULL) {
+ rescan_packets(cf, "Resetting", "Filter", FALSE);
+ } else {
+ rescan_packets(cf, "Filtering", dftext, FALSE);
+ }
}
/* Cleanup and release all dfilter resources */