Wireshark-commits: [Wireshark-commits] master-2.0 b449a6b: Check before setting the length of a pro
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sat, 1 Apr 2017 19:35:40 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=b449a6bae8a9128ae3b32eda0f5263ae3a9b7a08
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master-2.0
Repository: wireshark

Commits:

b449a6b 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>
    (cherry picked from commit de032c63e067197cbd9155082d12ffea5aed4c76)
    Reviewed-on: https://code.wireshark.org/review/20843
    

Actions performed:

    from  c4070d1   isns: fix dead code
    adds  b449a6b   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(-)