rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Donn Cave <donn@u.washington.edu>
To: rc@hawkwind.utcs.toronto.edu
Subject: segv on 0-length var
Date: Mon, 12 Oct 1992 19:54:44 -0400	[thread overview]
Message-ID: <9210122354.AA16285@carson.u.washington.edu> (raw)

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 {



                 reply	other threads:[~1992-10-12 23:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9210122354.AA16285@carson.u.washington.edu \
    --to=donn@u.washington.edu \
    --cc=rc@hawkwind.utcs.toronto.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).