diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2017-09-07 11:32:15 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2017-09-07 11:32:15 +0000 |
commit | 5202bae512094fe400d25de688ae6614d4410beb (patch) | |
tree | 4d50070eaf60e227d08e6aa23c811ab7ab96ca2d /sys/kern | |
parent | 66eedd7647e72bca1a5e283aa2831b85277e789f (diff) |
In elf_load_file() to not call free(9) with an uninitialized size
even if the pointer is NULL. This is not a real bug as free(9)
checks the addr pointer before the size value, but the compiler
cannot know that.
found by clang -Wuninitialized; OK deraadt@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/exec_elf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c index 8ab7a0ebd50..021a60d72b2 100644 --- a/sys/kern/exec_elf.c +++ b/sys/kern/exec_elf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.c,v 1.140 2017/03/20 00:05:21 kettenis Exp $ */ +/* $OpenBSD: exec_elf.c,v 1.141 2017/09/07 11:32:14 bluhm Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -318,7 +318,7 @@ elf_load_file(struct proc *p, char *path, struct exec_package *epp, struct nameidata nd; Elf_Ehdr eh; Elf_Phdr *ph = NULL; - u_long phsize; + u_long phsize = 0; Elf_Addr addr; struct vnode *vp; Elf_Phdr *base_ph = NULL; |