Ethereal-dev: Re: [Ethereal-dev] Re: [Ethereal-cvs] rev 14203: /trunk/epan/: proto.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Gerald Combs <gerald@xxxxxxxxxxxx>
Date: Wed, 27 Apr 2005 22:26:58 -0500
Guy Harris wrote:
> gerald@xxxxxxxxxxxx wrote:
> 
>> User: gerald
>> Date: 2005/04/27 11:22 AM
>>
>> Log:
>>  In alloc_field_info, throw a ReportedBoundsError if we're passed an
>>  invalid length.
> 
> 
> In practice, a negative (probably meaning very large positive) length
> would be beyond the packet length in almost all cases, but it might be a
> bit cleaner to use "tvb_ensure_bytes_exist()" to have it throw the
> appropriate exception.

I figured that since tvb_ensure_bytes_exist() threw a
ReportedBoundsError for lengths < 0, we could cut out the middleman and
do it ourselves.  After looking through the code again, adding
tvb_ensure_bytes_exist() makes more sense.  I'll check in a change.