]> The Tcpdump Group git mirrors - tcpdump/commit
When parsing information elements, check for the full length beforehand.
authorGuy Harris <[email protected]>
Sat, 19 Apr 2014 02:09:49 +0000 (19:09 -0700)
committerGuy Harris <[email protected]>
Sat, 19 Apr 2014 02:09:49 +0000 (19:09 -0700)
commit9f033017d58aca8f44c6c6e05e77daea35c67e0a
treece3e6e846fc542bfdc1a4943498a366747749b2a
parent12d1cd6dd82dd6ef60ae12d9030667af9a437f3a
When parsing information elements, check for the full length beforehand.

When parsing information elements, first check to make sure we have the
element ID and length, and fetch the length; then check to make sure we
have the entire element, including the information.  Remove those checks
from the handlers for individual elements.

This squelches a Coverity warning (when we check to make sure the length
remaining in the packet is enough for the element ID; the element ID is
one byte, and the loop continues as long as the length is non-zero, so
that's always true in the loop), and simplifies some other code.

Also check for the right length for fixed-length elements while we're at
it.
print-802_11.c