Ethereal-dev: Re: [Ethereal-dev] Exception in pdml

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, 26 Oct 2004 12:49:37 -0700
Wesley Shields wrote:

Agreed. I have a jpeg that when viewed through a browser the resulting capture will throw the exception when outputting to pdml. I can provide that jpeg, or the capture, if necessary (it's just a generic green ball used as a bullet in webpages).

I'd like to see the capture.

This idea is much better than my patch of checking for negative values when printing the pdml. If a dissector is setting a negative value what should be an appropriate fix?

Don't set a negative value. :-)

The reasons why a dissector might be doing that - i.e., the reasons why it's incorrectly computing a field length - would differ, so the fixes to make it stop would also differ.

I'd like to know so that the patch I will be writing for this particular dissector will match what you are doing with the rest. Is there any problem with setting the length to 0?

If the length of the field in the packet isn't 0, yes, there'd be a problem with setting the length to 0, as it'd be setting it to an incorrect value. (The fix isn't to just work around a bad length calculation by using 0, the fix is to stop calculating the length incorrectly.)