sh: Fix use-after-free when attempting to modify a read-only variable.
Reported by: bapt MFC after: 1 week
This commit is contained in:
parent
a2acf60284
commit
d41b2be159
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=292360
@ -330,7 +330,7 @@ setvareq(char *s, int flags)
|
|||||||
if (vp->flags & VREADONLY) {
|
if (vp->flags & VREADONLY) {
|
||||||
if ((flags & (VTEXTFIXED|VSTACK)) == 0)
|
if ((flags & (VTEXTFIXED|VSTACK)) == 0)
|
||||||
ckfree(s);
|
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 & VNOSET) {
|
||||||
if ((flags & (VTEXTFIXED|VSTACK)) == 0)
|
if ((flags & (VTEXTFIXED|VSTACK)) == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user