diff options
author | jilles <jilles@FreeBSD.org> | 2015-12-16 20:33:47 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2015-12-16 20:33:47 +0000 |
commit | 75b5654b2ad67db59f88e06222919f7a2a787ea7 (patch) | |
tree | 89026076c83304ac0e85c55d56c6d61d901f4c48 /bin/sh | |
parent | 22b67b80a947ec25c86b1236285c4913903fd51b (diff) | |
download | FreeBSD-src-75b5654b2ad67db59f88e06222919f7a2a787ea7.zip FreeBSD-src-75b5654b2ad67db59f88e06222919f7a2a787ea7.tar.gz |
sh: Fix use-after-free when attempting to modify a read-only variable.
Reported by: bapt
MFC after: 1 week
Diffstat (limited to 'bin/sh')
-rw-r--r-- | bin/sh/var.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/sh/var.c b/bin/sh/var.c index cfba0ba..c124a5d 100644 --- a/bin/sh/var.c +++ b/bin/sh/var.c @@ -330,7 +330,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) |