Wireshark-commits: [Wireshark-commits] master 867a182: Fix up get_hfi_length():
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Wed, 23 Apr 2014 04:41:13 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=867a1827e7dc88896ee27a107eb35c4b3973d270
Submitter: Anders Broman (a.broman58@xxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

867a182 by Jeff Morriss (jeff.morriss.ws@xxxxxxxxx):

    Fix up get_hfi_length():
    
    Treat FT_BYTES and a few others the same as FT_PROTOCOL: allow a zero length
    but throw an exception if the offset is already beyond the end of the TVB
    (prior to this change it would assert out).  This (when manually applied to
    master-1.10) fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9999 .
    
    While we're at it: tvb_captured_length_remaining() no longer returns -1 (see
    r52571) so don't expect it to.  Instead just use
    tvb_ensure_captured_length_remaining() to throw an exception if the offset is
    bad.
    
    Change-Id: I686722a4fed46b86139466afcf64ff02f319c702
    Reviewed-on: https://code.wireshark.org/review/1289
    Reviewed-by: Evan Huus <eapache@xxxxxxxxx>
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  9c8febd   Fix copy & paste error in tvb_extract_utf_16_string, tvb_extract_ucs_4_string.
    adds  867a182   Fix up get_hfi_length():


Summary of changes:
 epan/proto.c |   40 ++++++++++++++++------------------------
 1 file changed, 16 insertions(+), 24 deletions(-)