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

Ethereal-dev: Re: [Ethereal-dev] Possible problem in packet-gtp [negative length tvb_memcpy()]

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

From: Guy Harris <gharris@xxxxxxxxx>
Date: Tue, 30 Mar 2004 10:15:41 -0800
On Sun, Mar 28, 2004 at 11:06:21AM +0200, Yaniv Kaul wrote:
> In packet-gtp.c, is there a problem in the following routine, if length 
> = 1 ?

Yes.  The check should be whether the length is < 2 or not, as the
extension ID is 2 bytes, not 1 byte.

I checked in a fix, and also had it just use "proto_tree_add_item()" to
add the private extension's value - that way it all goes in, rather than
only putting no more than 63 bytes in.

That raises a question - are private extensions *always* text strings? 
If not, should it be put into the protocol tree as a byte array rather
than as a string?