aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2019-07-07 13:18:06 +0200
committerAnders Broman <a.broman58@gmail.com>2019-07-08 03:56:51 +0000
commit1f527124444eca32623d1b7a5303afd7b46e322e (patch)
treeb66bc0cd22effa7464dcfa58e549bc5e3510a02e /dumpcap.c
parentc32d27aa57b31fd195b65f3fbb5094b70ad26463 (diff)
dumpcap: fix uninitialized memory read on dumpcap -d errors
Reproduce with: dumpcap -pdf bad Change-Id: I8c1f80c9d88262bc57651e886740083ea8e6ad52 Fixes: 4d6cb744df ("Add a "-d" flag to dumpcap") Reviewed-on: https://code.wireshark.org/review/33863 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 0492b07ac0..374300b208 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -758,6 +758,7 @@ show_filter_code(capture_options *capture_opts)
/* OK, try to compile the capture filter. */
if (!compile_capture_filter(interface_opts->name, pcap_h, &fcode,
interface_opts->cfilter)) {
+ g_snprintf(errmsg, sizeof(errmsg), "%s", pcap_geterr(pcap_h));
pcap_close(pcap_h);
report_cfilter_error(capture_opts, j, errmsg);
return FALSE;