summaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/linux/linux_exec.c')
-rw-r--r--sys/compat/linux/linux_exec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_exec.c b/sys/compat/linux/linux_exec.c
index 7b40114a0ac..b96be60a26b 100644
--- a/sys/compat/linux/linux_exec.c
+++ b/sys/compat/linux/linux_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_exec.c,v 1.23 2004/04/15 00:22:42 tedu Exp $ */
+/* $OpenBSD: linux_exec.c,v 1.24 2005/12/30 19:46:55 miod Exp $ */
/* $NetBSD: linux_exec.c,v 1.13 1996/04/05 00:01:10 christos Exp $ */
/*-
@@ -266,6 +266,9 @@ exec_linux_aout_makecmds(p, epp)
int machtype, magic;
int error = ENOEXEC;
+ if (epp->ep_hdrvalid < sizeof(struct exec))
+ return (ENOEXEC);
+
magic = LINUX_N_MAGIC(linux_ep);
machtype = LINUX_N_MACHTYPE(linux_ep);