diff --git a/sys/kern/exec_elf32.c b/sys/kern/exec_elf32.c index bb1b62b523a3..a8624790a8cc 100644 --- a/sys/kern/exec_elf32.c +++ b/sys/kern/exec_elf32.c @@ -1,4 +1,4 @@ -/* $NetBSD: exec_elf32.c,v 1.109 2006/02/04 12:09:50 yamt Exp $ */ +/* $NetBSD: exec_elf32.c,v 1.110 2006/03/17 08:51:35 erh Exp $ */ /*- * Copyright (c) 1994, 2000, 2005 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ */ #include -__KERNEL_RCSID(1, "$NetBSD: exec_elf32.c,v 1.109 2006/02/04 12:09:50 yamt Exp $"); +__KERNEL_RCSID(1, "$NetBSD: exec_elf32.c,v 1.110 2006/03/17 08:51:35 erh Exp $"); /* If not included by exec_elf64.c, ELFSIZE won't be defined. */ #ifndef ELFSIZE @@ -444,6 +444,12 @@ elf_load_file(struct lwp *l, struct exec_package *epp, char *path, } } + if (base_ph == NULL) + { + error = ENOEXEC; + goto bad; + } + /* * Now compute the size and load address. */