diff options
author | 2008-06-12 17:02:04 +0000 | |
---|---|---|
committer | 2008-06-12 17:02:04 +0000 | |
commit | 292037e67932e4705ede7f6757691be19d29c9c8 (patch) | |
tree | 1999ab8326c8ba4bcc7a61ef84340b64d30b187f /sys/kern/exec_elf.c | |
parent | Fixed a memory leak in export noticed by joris. (diff) | |
download | wireguard-openbsd-292037e67932e4705ede7f6757691be19d29c9c8.tar.xz wireguard-openbsd-292037e67932e4705ede7f6757691be19d29c9c8.zip |
Oops, do not dereference a NULL function pointer used as an array end
marker; found the hard way by sturm@
Diffstat (limited to 'sys/kern/exec_elf.c')
-rw-r--r-- | sys/kern/exec_elf.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c index a65ceb374d0..19f4e36933f 100644 --- a/sys/kern/exec_elf.c +++ b/sys/kern/exec_elf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.c,v 1.64 2008/06/12 04:33:37 miod Exp $ */ +/* $OpenBSD: exec_elf.c,v 1.65 2008/06/12 17:02:04 miod Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -549,9 +549,7 @@ ELFNAME2(exec,makecmds)(struct proc *p, struct exec_package *epp) goto native; } #endif - for (i = 0; - i < sizeof(ELFNAME(probes)) / sizeof(ELFNAME(probes)[0]) && error; - i++) { + for (i = 0; ELFNAME(probes)[i].func != NULL && error; i++) { error = (*ELFNAME(probes)[i].func)(p, epp, interp, &pos, &os); } if (!error) |