ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: Re: [Ethereal-dev] Tethereal Bug "Dissector bug, protocol HTTP..."

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

From: "Ulf Lamping" <ulf.lamping@xxxxxx>
Date: Thu, 17 Mar 2005 17:23:15 +0100
LEGO <luis.ontanon@xxxxxxxxx>, Ethereal development <ethereal-dev@xxxxxxxxxxxx> schrieb am 17.03.05 16:54:24:
> 
> It's my fault.
> 
> I did not check the return value of tvb_find_guint8() to be something usable.
> 
> In this case It was clearly not usable. 
> 
> What should I do when I dicover that the packet I'm dissecting is
> clearly a malformed packet?
> 
> THROW(DissectorError) ?
> 

No, this would indicate that this is a bug in the dissectors implementation, but it's only a "bug" in the packet data coming in.

I usually simply try an attempt to read a very high number of bytes from the TVB so a BoundsError is thrown, getting "[Malformed Packet]" on the screen. I simply didn't know how to throw an error till I did some recent changes introducing DissectorError (together with Guy).

So the right thing might be to:

THROW(BoundsError)

in your case.

We might need to have a new exception PacketDataInvalid (or alike), which should be called in such situations, where the data incoming is obviously wrong and cannot be handled otherwise.

Regards, ULFL

______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193