]> The Tcpdump Group git mirrors - libpcap/commit
Fix test for message running past the end of the buffer.
authorGuy Harris <[email protected]>
Thu, 24 Aug 2017 17:46:13 +0000 (10:46 -0700)
committerGuy Harris <[email protected]>
Thu, 24 Aug 2017 17:46:13 +0000 (10:46 -0700)
commitb358d6f06eba402cb946509e53e6fa3bd69ef39e
tree0e2813ce305d2520616bc551f8aa4ebe5521876f
parent8a6e9589a4e1384ee60aaa2adb547ee63901a1d2
Fix test for message running past the end of the buffer.

len is no longer a variable used in the loop, so it doesn't reflect how
much data is left in the buffer after all the messages that have been
processed; compare the message length against ep - bp instead.

Remove a test that will always fail - at that point in the loop, we know
that bp < ep, so we know that ep - bp is > 0.

Add a check for pcap_breakloop() in the loop that reads buffers of
messages, as is done in other modules.

Put back the check to make sure that, before processing each message, we
have at least one minimum-sized message's worth of data left in the
buffer.

Add a bunch of comments.

Make the return statements use the no-parenthesis style used elsewhere
in this file.
pcap-netfilter-linux.c