Ethereal-dev: Re: [ethereal-dev] [PATCH] sigsegv in packet-nfs.c:1214 (proto_item_set_text)

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

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Sat, 26 Aug 2000 18:54:43 -0700
On Sat, Aug 26, 2000 at 02:21:31PM +0200, Florian Lohoff wrote:
> This patch solved it for although i dont know if this is any kind of
> correct

The check whether there are 4 bytes in the frame starting at "offset"
should be done regardless of whether "entry_item" is null or not; the
only thing to skip if "entry_item" is null is the
"proto_item_set_text()" call, so the right patch is probably this one,
which I'll check in:

Index: packet-nfs.c
===================================================================
RCS file: /usr/local/cvsroot/ethereal/packet-nfs.c,v
retrieving revision 1.36
diff -c -r1.36 packet-nfs.c
*** packet-nfs.c	2000/08/15 21:27:46	1.36
--- packet-nfs.c	2000/08/27 01:53:08
***************
*** 1211,1217 ****
  	}
  
  	if (!BYTES_ARE_IN_FRAME(offset, 4)) {
! 		proto_item_set_text(entry_item, "Entry: <TRUNCATED>");
  		return offset;
  	}
  	fileid = EXTRACT_UINT(pd, offset + 0);
--- 1211,1218 ----
  	}
  
  	if (!BYTES_ARE_IN_FRAME(offset, 4)) {
! 		if (entry_item)
! 			proto_item_set_text(entry_item, "Entry: <TRUNCATED>");
  		return offset;
  	}
  	fileid = EXTRACT_UINT(pd, offset + 0);