aboutsummaryrefslogtreecommitdiffstats
path: root/tfshark.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-02-18 12:52:21 -0800
committerGuy Harris <guy@alum.mit.edu>2018-02-18 20:52:52 +0000
commit0347538758f29b056c2e04959539bdc32f0291b6 (patch)
tree09f6d7185a4840a586fc2a4ffa4a8c9dacbe4e44 /tfshark.c
parentda861e431135c620a879358b32731125b3e7b495 (diff)
Don't start command-line taps until we've opened a file.
We shouldn't do so until we have something on which to compute statistics and until we're in file scope, as the taps may use file-scoped memory, given that statistics pertain to a file. Change-Id: I08b6e5ed145d7a25056857cc570f383f5116d6ce Reviewed-on: https://code.wireshark.org/review/25889 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tfshark.c')
-rw-r--r--tfshark.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/tfshark.c b/tfshark.c
index d6dc4ebd7b..5e91c90139 100644
--- a/tfshark.c
+++ b/tfshark.c
@@ -878,11 +878,6 @@ main(int argc, char *argv[])
line that their preferences have changed. */
prefs_apply_all();
- /* At this point MATE will have registered its field array so we can
- have a tap filter with one of MATE's late-registered fields as part
- of the filter. We can now process all the "-z" arguments. */
- start_requested_stats();
-
/*
* Enabled and disabled protocols and heuristic dissectors as per
* command-line options.
@@ -958,6 +953,14 @@ main(int argc, char *argv[])
goto clean_exit;
}
+ /* Start statistics taps; we do so after successfully opening the
+ capture file, so we know we have something to compute stats
+ on, and after registering all dissectors, so that MATE will
+ have registered its field array so we can have a tap filter
+ with one of MATE's late-registered fields as part of the
+ filter. */
+ start_requested_stats();
+
/* Process the packets in the file */
TRY {
/* XXX - for now there is only 1 packet */