Skip to content

Commit 3dd16d4

Browse files
committed
Add regression test for PCAPNG options bounds
1 parent 957bdb1 commit 3dd16d4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

test/regression.uts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,6 +2348,11 @@ file = BytesIO(b'\xd4\xc3\xb2\xa1\x02\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x0
23482348
l = rdpcap(file)
23492349
assert len(l) == 0 or ARP in l[0]
23502350

2351+
# Read PCAPNG file with tightly packed comment option, no End of Options
2352+
file = BytesIO(b'\n\r\r\n\x1c\x00\x00\x00M<+\x1a\x01\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x1c\x00\x00\x00\x01\x00\x00\x00\x14\x00\x00\x00\x01\x00\x00\x00\x00\x00\x04\x00\x14\x00\x00\x00\x06\x00\x00\x00,\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x08\x00Helloooo,\x00\x00\x00')
2353+
l = rdpcap(file)
2354+
assert len(l) == 1 and l[0].comment == b'Helloooo'
2355+
23512356
= Read a pcap file with wirelen != captured len
23522357
pktpcapwirelen = rdpcap(pcapwirelenfile)
23532358

0 commit comments

Comments
 (0)