Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/sunos Stack buffers mustn't escape their scope. P...



details:   https://anonhg.NetBSD.org/src/rev/13de4b3afa76
branches:  trunk
changeset: 962191:13de4b3afa76
user:      dholland <dholland%NetBSD.org@localhost>
date:      Wed Jul 03 18:24:50 2019 +0000

description:
Stack buffers mustn't escape their scope. PR 54326 from David Binderman

diffstat:

 sys/compat/sunos/sunos_misc.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r d97499d5a327 -r 13de4b3afa76 sys/compat/sunos/sunos_misc.c
--- a/sys/compat/sunos/sunos_misc.c     Wed Jul 03 17:40:29 2019 +0000
+++ b/sys/compat/sunos/sunos_misc.c     Wed Jul 03 18:24:50 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sunos_misc.c,v 1.172 2018/09/03 16:29:30 riastradh Exp $       */
+/*     $NetBSD: sunos_misc.c,v 1.173 2019/07/03 18:24:50 dholland Exp $        */
 
 /*
  * Copyright (c) 1992, 1993
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.172 2018/09/03 16:29:30 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.173 2019/07/03 18:24:50 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1013,6 +1013,7 @@
        struct sunos_howto_conv *convp;
        int error, bsd_howto, sun_howto;
        char *bootstr;
+       char bs[128];
 
        if ((error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_REBOOT,
            0, NULL, NULL, NULL)) != 0)
@@ -1036,8 +1037,6 @@
         * next booted kernel.
         */
        if (sun_howto & SUNOS_RB_STRING) {
-               char bs[128];
-
                error = copyinstr(SCARG(uap, bootstr), bs, sizeof(bs), 0);
 
                if (error)



Home | Main Index | Thread Index | Old Index