Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-bugs: [Wireshark-bugs] [Bug 6175] wslua: Add reported_length_remaining to tvb

Date: Wed, 10 Aug 2011 14:46:41 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6175

Jeff Morriss <jeff.morriss.ws@xxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jeff.morriss.ws@xxxxxxxxx

--- Comment #5 from Jeff Morriss <jeff.morriss.ws@xxxxxxxxx> 2011-08-10 14:46:40 PDT ---
Keep in mind that tvb_reported_length_remaining() may return -1 if the offset
is past the end of the TVB.  No exception is thrown.  This can make the
function somewhat dangerous; a quick 'grep' through the dissectors shows a
number of places where this function is mis-used, for example:

epan/dissectors/packet-cdp.c:    while (tvb_reported_length_remaining(tvb,
offset) != 0) {

Maybe it would make more sense to (only) supply tvb_reported_length() as a Lua
API?  I added that (untested) in r38461.

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.