Wireshark-commits: [Wireshark-commits] master-2.2 5bd9489: Check before setting the length of a pro

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sat, 1 Apr 2017 19:30:28 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=5bd9489aa8118e0858509eed7c251069f5620066
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master-2.2
Repository: wireshark

Commits:

5bd9489 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/20841
    

Actions performed:

    from  21d8c7a   Improve the display of metrics.
    adds  5bd9489   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(-)