Source-Changes-HG archive

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

[src/netbsd-3]: src/sys/kern Apply patch (requested by elad in ticket #885):



details:   https://anonhg.NetBSD.org/src/rev/5542226795e7
branches:  netbsd-3
changeset: 577370:5542226795e7
user:      riz <riz%NetBSD.org@localhost>
date:      Sat Oct 15 17:33:31 2005 +0000

description:
Apply patch (requested by elad in ticket #885):
Check if vhe->fp is not NULL before passing it to free(), to prevent
a crash.

diffstat:

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

diffs (28 lines):

diff -r 15f364612d72 -r 5542226795e7 sys/kern/kern_verifiedexec.c
--- a/sys/kern/kern_verifiedexec.c      Sat Oct 15 17:17:28 2005 +0000
+++ b/sys/kern/kern_verifiedexec.c      Sat Oct 15 17:33:31 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_verifiedexec.c,v 1.9.2.27 2005/09/08 21:06:31 tron Exp $  */
+/*     $NetBSD: kern_verifiedexec.c,v 1.9.2.28 2005/10/15 17:33:31 riz 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.9.2.27 2005/09/08 21:06:31 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_verifiedexec.c,v 1.9.2.28 2005/10/15 17:33:31 riz Exp $");
 
 #include "opt_verified_exec.h"
 
@@ -496,7 +496,8 @@
        }
 
        LIST_REMOVE(vhe, entries);
-       free(vhe->fp, M_TEMP);
+       if (vhe->fp != NULL)
+               free(vhe->fp, M_TEMP);
        free(vhe, M_TEMP);
        tbl->hash_count--;
 



Home | Main Index | Thread Index | Old Index