Wireshark-commits: [Wireshark-commits] master 5c51008: Fix handling of guintvars.
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=5c51008ef0898adae9ce12283e34b29a9c406c9f
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark
Commits:
5c51008 by Guy Harris (guy@xxxxxxxxxxxx):
Fix handling of guintvars.
1) A value that fits in a 32-bit unsigned integer may take more than 4
octets - the uppermost bit of the octet is a "more octets follows" flag,
so 4 octets contain only 7*4 - 28 bits of value, so a fifth octet
preceding that with the upper 3 bits zero could result in a value that
fits in 32 bits, and further octets of 0x80 just add further leading
zeroes.
We should, instead, check for *overflow*, meaning that if we add more
bits at the bottom, the result is *less* than the previous value.
2) When the result overflows, we should clamp it a UINT_MAX, rather than
setting it to zero, and should keep accumulating octets, so that we
return the correct octet count. That prevents infinite loops where the
item's length, and the item itself, are considered zero-length.
This should fix bug 14738.
Bug: 14738
Change-Id: I1d1b60e22f169959c1573b1fcb7e010e027b5132
Reviewed-on: https://code.wireshark.org/review/27986
Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
Actions performed:
from f5faa1e [Automatic update for 2018-06-03]
adds 5c51008 Fix handling of guintvars.
Summary of changes:
epan/dissectors/packet-wap.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)