Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Fix potential NULL pointer access.



details:   https://anonhg.NetBSD.org/src/rev/69c11128ff08
branches:  trunk
changeset: 582025:69c11128ff08
user:      elad <elad%NetBSD.org@localhost>
date:      Mon Jun 13 21:09:49 2005 +0000

description:
Fix potential NULL pointer access.

diffstat:

 sys/kern/kern_verifiedexec.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 3d396d11ef90 -r 69c11128ff08 sys/kern/kern_verifiedexec.c
--- a/sys/kern/kern_verifiedexec.c      Mon Jun 13 20:52:13 2005 +0000
+++ b/sys/kern/kern_verifiedexec.c      Mon Jun 13 21:09:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_verifiedexec.c,v 1.22 2005/06/13 20:52:13 elad Exp $      */
+/*     $NetBSD: kern_verifiedexec.c,v 1.23 2005/06/13 21:09:49 elad Exp $      */
 
 /*-
  * Copyright 2005 Elad Efrat <elad%bsd.org.il@localhost>
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_verifiedexec.c,v 1.22 2005/06/13 20:52:13 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_verifiedexec.c,v 1.23 2005/06/13 21:09:49 elad Exp $");
 
 #include <sys/param.h>
 #include <sys/mount.h>
@@ -396,7 +396,7 @@
        case VERIEXEC_INDIRECT:
                break;
        case VERIEXEC_FILE:
-               if (vp->vhe->type != VERIEXEC_FILE) {
+               if ((vp->vhe != NULL) && (vp->vhe->type != VERIEXEC_FILE)) {
                        veriexec_report("Execution of 'FILE' entry.",
                                        name, va, p, REPORT_NOVERBOSE,
                                        REPORT_ALARM, REPORT_NOPANIC);
@@ -404,6 +404,7 @@
                        if (veriexec_strict > 1)
                                return (EPERM);
                }
+
                break;
        }
 



Home | Main Index | Thread Index | Old Index