editcap fails when splitting into multiple pcapng files
In wireshark 3.4.0 when converting a pcap file to a pcapng file and splitting on a specified number of packets, there is an error generating the second pcapng file.
Steps to reproduce
editcap -c 100 -F pcapng test.pcap tmp.pcapng
What is the current bug behavior?
editcap: An internal error occurred while writing record 101 of file "test.pcap" to the file "tmp_00001_20200825115256.pcapng". (pcapng: epb.interface_id (0) >= wdh->interface_data->len (0))
What is the expected correct behavior?
Editcap should generate multiple tmp_*.pcapng files, each with 100 packets, prepended with the section header and interface descriptor block. This is correct in wireshark release 3.2.8.
Version 3.4.0 (v3.4.0-0-g9733f173ea5e) Copyright 1998-2020 Gerald Combs <email@example.com> and contributors. License GPLv2+: GNU GPL version 2 or later <https://www.gnu.org/licenses/gpl-2.0.html> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Compiled (32-bit) with Qt 5.15.1, with libpcap, with GLib 2.52.3, with zlib 1.2.11, with SMI 0.4.8, with c-ares 1.15.0, with Lua 5.2.4, with GnuTLS 3.6.3 and PKCS #11 support, with Gcrypt 1.8.3, with MIT Kerberos, with MaxMind DB resolver, with nghttp2 1.39.2, with brotli, with LZ4, with Zstandard, with Snappy, with libxml2 2.9.9, with QtMultimedia, with automatic updates using WinSparkle 0.5.7, with AirPcap, with SpeexDSP (using bundled resampler). Running on 64-bit Windows 10 (1809), build 17763, with Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (with SSE4.2), with 32603 MB of physical memory, with locale English_United States.utf8, with light display mode, without HiDPI, with WinPcap version 4.1.2 (packet.dll version 184.108.40.2061), based on libpcap version 1.0 branch 1_0_rel0b (20091008), with GnuTLS 3.6.3, with Gcrypt 1.8.3, with brotli 1.0.2, with AirPcap 4.1.0 build 1622, binary plugins supported (21 loaded). Built using Microsoft Visual Studio 2019 (VC++ 14.27, build 29112).