Wireshark-commits: [Wireshark-commits] master de032c6: Check before setting the length of a protoco
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=de032c63e067197cbd9155082d12ffea5aed4c76
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark
Commits:
de032c6 by Guy Harris (guy@xxxxxxxxxxxx):
Check before setting the length of a protocol item.
Don't assume that 8 + {32-bit unsigned integer} won't overflow. Use
tvb_ensure_bytes_exist() to ensure that the data in question is present;
it also checks for overflows.
Also, set the length after we've succeeded in dissecting the item - if
we throw an exception, it's because we don't have all the data, so the
tvb_ensure_bytes_exist() would have failed, but this way we at least get
to dissect what data we *do* have.
Change-Id: If27a2e3ed7978c2051ccb2ddba0d498255d0e350
Reviewed-on: https://code.wireshark.org/review/20840
Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
Actions performed:
from 38bc42b Fix IPv6/IPX statistics generation
adds de032c6 Check before setting the length of a protocol item.
Summary of changes:
epan/dissectors/packet-isns.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)