rusticata / pcap-parser

PCAP/PCAPNG file format parser written in pure Rust. Fast, zero-copy, safe.
Other
103 stars 24 forks source link

Fix PcapNGOption 32 bits conversions #39

Closed zz85 closed 1 week ago

zz85 commented 3 months ago

both .as_i32_le() and .as_u32_le() in PcapNGOption are expecting 4 bytes. Even though the comments and code is expecting 4 bytes, the checks are incorrectly checking for 8 bytes, causing these 2 functions to return error wrongly. This change fixes the checks so the function behaves correctly.

chifflier commented 1 week ago

Applied, thanks!