Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh Fix a reference after free (and consequent nonsense d...



details:   https://anonhg.NetBSD.org/src/rev/9d0e05d4247f
branches:  trunk
changeset: 355095:9d0e05d4247f
user:      kre <kre%NetBSD.org@localhost>
date:      Wed Jul 12 19:06:16 2017 +0000

description:
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.

diffstat:

 bin/sh/var.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 1885d66c8b6b -r 9d0e05d4247f bin/sh/var.c
--- a/bin/sh/var.c      Wed Jul 12 17:55:24 2017 +0000
+++ b/bin/sh/var.c      Wed Jul 12 19:06:16 2017 +0000
@@ -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 @@
                                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)



Home | Main Index | Thread Index | Old Index