Wireshark-dev: Re: [Wireshark-dev] Malformed packets in CORBA protocol plugin
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Tue, 12 Dec 2006 01:50:51 -0800

On Dec 12, 2006, at 1:40 AM, Andy.Ling@xxxxxxxxxxx wrote:

Guy Harris <guy@xxxxxxxxxxxx> wrote on 11/12/2006 18:50:43:

It *is* designed to cope with offset beyond the buffer length - an
offset beyond the buffer length is an obvious error, so it throws an
exception.


Except in this case it is not an error.

Yes, it is. It makes no sense whatsoever to add a protocol tree item that refers to data past the end of the packet, as that data doesn't exist. It's designed to cope with the offset being beyond the buffer length by throwing an exception to report an error. If the packet isn't erroneous, then the bug isn't that proto_tree_add_item() isn't doing what it should be doing (it's doing exactly what it should be doing), it's that it shouldn't be called with that offset in the first place.