aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-11-09 19:03:07 -0800
committerGuy Harris <guy@alum.mit.edu>2018-11-10 03:03:42 +0000
commitc0aad886bad7374a4990db32cfc2cda78a77bf75 (patch)
tree01f5a53fe5616524168cb38135a3d11d9efd85d1 /dumpcap.c
parent3b68fc9fd4c307008d4bad685cab01889d375080 (diff)
capture_loop_write_pcapng_cb() shouldn't be called if use_pcapng is false.
If it *is* called when global_capture_opts.use_pcapng is false, don't just silently drop the packet on the floor, abort. Change-Id: Idb8f8e4c4ba231cfe674a81da34bf46e00f8247c Reviewed-on: https://code.wireshark.org/review/30562 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/dumpcap.c b/dumpcap.c
index ceeca8c82d..23fe8b03f0 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -4191,9 +4191,11 @@ capture_loop_write_pcapng_cb(capture_src *pcap_src, const struct pcapng_block_he
{
int err;
- if (!global_capture_opts.use_pcapng) {
- return;
- }
+ /*
+ * This should never be called if we're not writing pcapng.
+ */
+ g_assert(global_capture_opts.use_pcapng);
+
/* We may be called multiple times from pcap_dispatch(); if we've set
the "stop capturing" flag, ignore this packet, as we're not
supposed to be saving any more packets. */