Ethereal-dev: Re: [Ethereal-dev] Ethereal crashed when opening captured file (ERROR tvbuff.c)

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

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Wed, 15 Oct 2003 00:20:43 -0700
On Tue, Oct 14, 2003 at 08:38:11AM +0200, Aschenneller, Daniel wrote:
> #5  0x082e9280 in ensure_contiguous (tvb=0x1172a7a0, offset=32, length=-1079278004) at tvbuff.c:898

I think this might be a bug that was fixed after Ethereal 0.9.15 was
released.

If you can compile Ethereal from source, either try the current CVS
version (which requires that you have a bunch of stuff such as autoconf,
automake, Perl, Python, etc. installed) or apply the attached patch to
0.9.15's "epan/tvbuff.c", recompile, and try that.

The capture file is probably in "/tmp" or "/var/tmp", with a name
beginning with "ether" and having a bunch of letters and/or numbers
after it.
Index: tvbuff.c
===================================================================
RCS file: /usr/local/cvsroot/ethereal/epan/tvbuff.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -c -r1.50 -r1.51
*** epan/tvbuff.c	10 Sep 2003 21:19:47 -0000	1.50
--- epan/tvbuff.c	28 Sep 2003 21:39:53 -0000	1.51
***************
*** 408,413 ****
--- 408,417 ----
  
  	/* Compute the length */
  	if (length < -1) {
+ 		if (exception) {
+ 			/* XXX - ReportedBoundsError? */
+ 			*exception = BoundsError;
+ 		}
  		return FALSE;
  	}
  	else if (length == -1) {
***************
*** 480,489 ****
  		guint *offset_ptr, guint *length_ptr)
  {
  	int exception = 0;
- 
- 	if (length < -1) {
- 		THROW(BoundsError);
- 	}
  
  	if (!check_offset_length_no_exception(tvb, offset, length, offset_ptr, length_ptr, &exception)) {
  		g_assert(exception > 0);
--- 484,489 ----