Module Name: src
Committed By: kre
Date: Wed Jul 12 19:06:16 UTC 2017
Modified Files:
src/bin/sh: var.c
Log Message:
Fix a reference after free (and consequent nonsense diagnostic for
attempts to set readonly variables) I added in 1.60 by incompletely
copying the FreeBSD fix for the lost memory issue.
To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/bin/sh/var.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/sh/var.c
diff -u src/bin/sh/var.c:1.64 src/bin/sh/var.c:1.65
--- src/bin/sh/var.c:1.64 Wed Jul 5 20:00:27 2017
+++ src/bin/sh/var.c Wed Jul 12 19:06:16 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.64 2017/07/05 20:00:27 kre Exp $ */
+/* $NetBSD: var.c,v 1.65 2017/07/12 19:06:16 kre Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: var.c,v 1.64 2017/07/05 20:00:27 kre Exp $");
+__RCSID("$NetBSD: var.c,v 1.65 2017/07/12 19:06:16 kre Exp $");
#endif
#endif /* not lint */
@@ -431,7 +431,7 @@ setvareq(char *s, int flags)
ckfree(s);
if (flags & VNOERROR)
return;
- error("%.*s: is read only", vp->name_len, s);
+ error("%.*s: is read only", vp->name_len, vp->text);
}
if (flags & VNOSET) {
if ((flags & (VTEXTFIXED|VSTACK)) == 0)