Wireshark-dev: Re: [Wireshark-dev] tvb_length_remaining() and tvb_reported_length_remaining()

From: Christopher Maynard <Christopher.Maynard@xxxxxxxxx>
Date: Thu, 12 Jul 2012 16:14:01 +0000 (UTC)
Jakub Zawadzki <darkjames-ws@...> writes:

> 
> On Mon, Jul 09, 2012 at 04:10:53PM +0000, Christopher Maynard wrote:
> > Would replacement functions help here which would return an out-of-bounds 
> > error
> > in one of their arguments, so that things would look instead something like:
> > 
> > len2 = tvb_length_remaining_new(tvb, offset, &error);
> > if (error == TBD)
> >   return offset;
> 
> Can this new function throw exception when offset is out of bounds?

Possibly, but I was under the impression that these type of functions were used
when you specifically wanted to know how much data remains, if any, w/out
throwing an exception if the offset happened to be out of bounds?