From 7574bb3027376b2840048751d6378d45e190296a Mon Sep 17 00:00:00 2001 From: Pierre LALET <pierre.lalet@cea.fr> Date: Sun, 12 Apr 2015 18:25:15 +0200 Subject: [PATCH] wrpcap() creates a valid PCAP file when called with an empty list --HG-- branch : issue-5111 --- scapy/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scapy/utils.py b/scapy/utils.py index 98fd6376..c9bf4ede 100644 --- a/scapy/utils.py +++ b/scapy/utils.py @@ -714,6 +714,7 @@ class RawPcapWriter: try: p = pkt.next() except StopIteration: + self._write_header("") return self._write_header(p) self._write_packet(p) -- GitLab