summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2015-12-23 18:24:40 +0000
committerjilles <jilles@FreeBSD.org>2015-12-23 18:24:40 +0000
commitce8728e0fac8e73c4cf9e1fb0aefa24b63b0813a (patch)
treecc93de9a13eede769c8bba5cdc8ad68655e523ae /bin
parentf5638e51344c0944f71c9a8782413ec130750d3a (diff)
downloadFreeBSD-src-ce8728e0fac8e73c4cf9e1fb0aefa24b63b0813a.zip
FreeBSD-src-ce8728e0fac8e73c4cf9e1fb0aefa24b63b0813a.tar.gz
MFC r292360: sh: Fix use-after-free when attempting to modify a read-only
variable. Reported by: bapt
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/var.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/sh/var.c b/bin/sh/var.c
index ebeff16..d083523 100644
--- a/bin/sh/var.c
+++ b/bin/sh/var.c
@@ -328,7 +328,7 @@ setvareq(char *s, int flags)
if (vp->flags & VREADONLY) {
if ((flags & (VTEXTFIXED|VSTACK)) == 0)
ckfree(s);
- 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)
OpenPOWER on IntegriCloud