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>
This commit is contained in:
Guy Harris 2018-11-09 19:03:07 -08:00
parent 3b68fc9fd4
commit c0aad886ba
1 changed files with 5 additions and 3 deletions

View File

@ -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. */