Source-Changes-HG archive

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

[src/netbsd-2]: src/sys/kern Pull up following revision(s) (requested by erh ...



details:   https://anonhg.NetBSD.org/src/rev/98523dfb8496
branches:  netbsd-2
changeset: 564436:98523dfb8496
user:      riz <riz%NetBSD.org@localhost>
date:      Mon Mar 20 17:52:20 2006 +0000

description:
Pull up following revision(s) (requested by erh in ticket #10380):
        sys/kern/exec_elf32.c: revisions 1.110-1.111
Found by coverity issue 887.  Check for NULL before using base_ph so
an interpreter that does not have PT_LOAD in the program header doesn't
crash the system.
Also, KNF.

diffstat:

 sys/kern/exec_elf32.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r b82188e6277e -r 98523dfb8496 sys/kern/exec_elf32.c
--- a/sys/kern/exec_elf32.c     Fri Mar 17 17:30:36 2006 +0000
+++ b/sys/kern/exec_elf32.c     Mon Mar 20 17:52:20 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec_elf32.c,v 1.97.2.1 2004/08/15 13:50:18 tron Exp $ */
+/*     $NetBSD: exec_elf32.c,v 1.97.2.1.2.1 2006/03/20 17:52:20 riz Exp $      */
 
 /*-
  * Copyright (c) 1994, 2000 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: exec_elf32.c,v 1.97.2.1 2004/08/15 13:50:18 tron Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exec_elf32.c,v 1.97.2.1.2.1 2006/03/20 17:52:20 riz Exp $");
 
 /* If not included by exec_elf64.c, ELFSIZE won't be defined. */
 #ifndef ELFSIZE
@@ -421,6 +421,11 @@
                        }
                }
 
+               if (base_ph == NULL) {
+                       error = ENOEXEC;
+                       goto bad;
+               }
+
                /*
                 * Now compute the size and load address.
                 */



Home | Main Index | Thread Index | Old Index