Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Avoid NULL pointer dereference. kern/17438, xs@kit...



details:   https://anonhg.NetBSD.org/src/rev/53bf2ed335b6
branches:  trunk
changeset: 533505:53bf2ed335b6
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Jul 02 16:22:28 2002 +0000

description:
Avoid NULL pointer dereference.  kern/17438, xs%kittenz.org@localhost.

diffstat:

 sys/kern/kern_systrace.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (35 lines):

diff -r 708ff777613f -r 53bf2ed335b6 sys/kern/kern_systrace.c
--- a/sys/kern/kern_systrace.c  Tue Jul 02 16:16:33 2002 +0000
+++ b/sys/kern/kern_systrace.c  Tue Jul 02 16:22:28 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_systrace.c,v 1.4 2002/07/02 16:16:33 thorpej Exp $        */
+/*     $NetBSD: kern_systrace.c,v 1.5 2002/07/02 16:22:28 thorpej Exp $        */
 
 /*
  * Copyright 2002 Niels Provos <provos%citi.umich.edu@localhost>
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_systrace.c,v 1.4 2002/07/02 16:16:33 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_systrace.c,v 1.5 2002/07/02 16:22:28 thorpej Exp $");
 
 #include "opt_systrace.h"
 
@@ -704,10 +704,12 @@
        if (fst) {
                SYSTRACE_UNLOCK(fst, p);
        }
-       if (error == 0)
-               strp->oldemul = p->p_emul;
-       else
-               strp->oldemul = NULL;
+       if (strp != NULL) {
+               if (error == 0)
+                       strp->oldemul = p->p_emul;
+               else
+                       strp->oldemul = NULL;
+       }
        return error;
 }
 



Home | Main Index | Thread Index | Old Index