Ethereal-dev: [Ethereal-dev] packet-pres dissector doesn't work properly after SVN-14193.

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

From: "Yuriy Sidelnikov" <ysidelnikov@xxxxxxxxxxx>
Date: Tue, 03 May 2005 12:29:15 +0000
Hi,
I've found recently that presentation dissector doesn't work properly now.
I guess reason is in wrong using of tvb_ensure_bytes_exist function.
SVN-14193 has added a lot of lines looks like :
tvb_ensure_bytes_exist(tvb, offset, -1);
As I can see from comment in the tvb_ensure_bytes_exist function:
	/*
	 * -1 doesn't mean "until end of buffer", as that's pointless
	 * for this routine.  We must treat it as a Really Large Positive
	 * Number, so that we throw an exception; we throw
	 * ReportedBoundsError, as if it were past even the end of a
	 * reassembled packet, and past the end of even the data we
	 * didn't capture.
	 *
	 * We do the same with other negative lengths.
	 */
So I don't think we can use -1 as argument for this function because -1 will always throw exception.
We need to use real length but sometimes it is not very easy.
Regards,
Yuriy Sidelnikov.

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/