Wireshark-commits: [Wireshark-commits] rev 36615: /trunk/ /trunk/epan/dissectors/: packet-snmp.c /t
Date: Tue, 12 Apr 2011 22:23:06 GMT
http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=36615

User: sfisher
Date: 2011/04/12 03:23 PM

Log:
 Fix Coverity 524: NEGATIVE_RETURNS
 
 Coverity sees that two calls to tvb_length_remaining() with an offset
 of 0 may return -1 (for an "out of bounds" condition), which would lead
 to an assignment of -1 to an unsigned variable and then passing it
 to functions further down that cannot accept negative values.
 
 Use tvb_ensure_length_remaining() to throw an exception in a case of
 out of bounds access (though unlikely with an offset of 0) instead of
 tvb_length_remaining(), which would return -1.

Directory: /trunk/epan/dissectors/
  Changes    Path             Action
  +2 -2      packet-snmp.c    Modified

Directory: /trunk/asn1/snmp/
  Changes    Path                      Action
  +2 -2      packet-snmp-template.c    Modified