-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fuzz: asserts cap_len is always lesser than length #979
base: master
Are you sure you want to change the base?
Conversation
To quote MSVC:
|
Oops thanks Guy |
@fxlb: I think you added checks for caplen > len, but was that in libpcap or tcpdump? Should we treat caplen > len as an error and fail, should we just increase len to be = caplen, or should we leave that to applications using libpcap? |
It was in tcpdump: https://github.com/the-tcpdump-group/tcpdump/blob/a38f788edf0df65f63c84241a4ac5f372c86c7dd/print.c#L348:L355
I need a little time to think about that. |
In my case, I think this is rather error and fail (or leave it to the applications using libpcap) than increase len to caplen=0x63503d00 on my 2kb pcap |
Could you add this pcap file for a test (.gz or .zip) ? |
I mean in this conversation. |
$ ls -lh fail.pcap "my 2kb pcap"? |
Yes it is not 2kb :-p I was thinking about another one |
But it is still less than 0x63503d00 bytes |
Ok, in this pcap file there is one pkt with len=1666202880 (=0x63503D00),[ not caplen] and caplen=0 [not len]. |
Sorry my mistake... No there pcaps. |
It is my understanding that
cap_len
should always be lesser thanlen
cf https://stackoverflow.com/questions/1491660/pcap-struct-pcap-pkthdr-len-vs-caplen
If so, the PR enhances one fuzz target to add this check.
I have a pcap with len=0 and caplen=0x63503d00