Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/arm The uninitialized variable in this case was...



details:   https://anonhg.NetBSD.org/src/rev/c899c1aac15c
branches:  trunk
changeset: 554519:c899c1aac15c
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Wed Oct 29 04:38:50 2003 +0000

description:
The uninitialized variable in this case was a bug, which could probably be
used to crash the system.

diffstat:

 sys/arch/arm/arm/syscall.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (40 lines):

diff -r 97fb7a4c3ef5 -r c899c1aac15c sys/arch/arm/arm/syscall.c
--- a/sys/arch/arm/arm/syscall.c        Wed Oct 29 04:25:46 2003 +0000
+++ b/sys/arch/arm/arm/syscall.c        Wed Oct 29 04:38:50 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: syscall.c,v 1.21 2003/10/26 23:11:15 chris Exp $       */
+/*     $NetBSD: syscall.c,v 1.22 2003/10/29 04:38:50 mycroft Exp $     */
 
 /*-
  * Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@@ -82,7 +82,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.21 2003/10/26 23:11:15 chris Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.22 2003/10/29 04:38:50 mycroft Exp $");
 
 #include <sys/device.h>
 #include <sys/errno.h>
@@ -336,8 +336,6 @@
        register_t *ap, *args, copyargs[MAXARGS], rval[2];
        ksiginfo_t ksi;
 
-       args = NULL;
-
        KERNEL_PROC_LOCK(p);
 
        switch (insn & SWI_OS_MASK) { /* Which OS is the SWI from? */
@@ -407,11 +405,11 @@
        else {
                KASSERT(nargs <= MAXARGS);
                memcpy(copyargs, ap, nap * sizeof(register_t));
+               args = copyargs;
                error = copyin((void *)frame->tf_usr_sp, copyargs + nap,
                    (nargs - nap) * sizeof(register_t));
                if (error)
                        goto bad;
-               args = copyargs;
        }
 
        if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)



Home | Main Index | Thread Index | Old Index