From 2441118d90e674410bfef5a5347b7b059a0da1af Mon Sep 17 00:00:00 2001 From: jilles Date: Wed, 23 Dec 2015 18:24:40 +0000 Subject: [PATCH] MFC r292360: sh: Fix use-after-free when attempting to modify a read-only variable. Reported by: bapt git-svn-id: svn://svn.freebsd.org/base/stable/10@292664 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- bin/sh/var.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/sh/var.c b/bin/sh/var.c index ebeff1663..d083523a0 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) -- 2.45.0