rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* segv on 0-length var
@ 1992-10-12 23:54 Donn Cave
  0 siblings, 0 replies; only message in thread
From: Donn Cave @ 1992-10-12 23:54 UTC (permalink / raw)
  To: rc

Following up on this bug:

	; Z='' rc
		; whatis Z
		Z=''
		; Z = ouch
		segmentation violation--core dumped
	;

The appended patch seems to fix it.  The problem arises when listfree()
attempts to free the variable value.  The patch is against version 1.4.

	Donn Cave, University Computing Services, University of Washington
	donn@cac.washington.edu
-------------------------------
*** footobar.c.dist	Fri Feb 14 09:05:01 1992
--- footobar.c	Mon Oct 12 15:49:28 1992
***************
*** 260,266 ****
  	top = r = enew(List);
  	extdef = strchr(extdef, '=') + 1;
  	if ((f = getenvw(extdef, FALSE)) == NULL) {
! 		r->w = "";
  		r->m = NULL;
  		r->n = NULL;
  	} else {
--- 260,267 ----
  	top = r = enew(List);
  	extdef = strchr(extdef, '=') + 1;
  	if ((f = getenvw(extdef, FALSE)) == NULL) {
! 		r->w = ealloc (1);
! 		r->w[0] = 0;
  		r->m = NULL;
  		r->n = NULL;
  	} else {



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1992-10-12 23:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-10-12 23:54 segv on 0-length var Donn Cave

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).