diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2014-06-21 08:00:24 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2014-06-21 08:00:24 +0000 |
commit | 029bd623b840ee0c0ca16b03d9a1ee177cdd31e9 (patch) | |
tree | adcd53bff97a1881f29c5f29d7f1fe74acce03b8 /libexec/ld.so/resolve.c | |
parent | d03a8d539ef55e2af53ca76005a541a0b2fdd808 (diff) |
Move to a non-zeroing _dl_malloc, a _dl_calloc and _dl_reallocarry and
fix _dl_strdup to return NULL instead of crash; ok deraadt@
Diffstat (limited to 'libexec/ld.so/resolve.c')
-rw-r--r-- | libexec/ld.so/resolve.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libexec/ld.so/resolve.c b/libexec/ld.so/resolve.c index 1956dc39290..09ec28631b3 100644 --- a/libexec/ld.so/resolve.c +++ b/libexec/ld.so/resolve.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resolve.c,v 1.65 2013/11/27 21:25:25 deraadt Exp $ */ +/* $OpenBSD: resolve.c,v 1.66 2014/06/21 08:00:23 otto Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -245,7 +245,7 @@ _dl_finalize_object(const char *objname, Elf_Dyn *dynp, Elf_Phdr *phdrp, _dl_printf("objname [%s], dynp %p, objtype %x lbase %lx, obase %lx\n", objname, dynp, objtype, lbase, obase); #endif - object = _dl_malloc(sizeof(elf_object_t)); + object = _dl_calloc(1, sizeof(elf_object_t)); object->prev = object->next = NULL; object->load_dyn = dynp; @@ -329,6 +329,7 @@ _dl_finalize_object(const char *objname, Elf_Dyn *dynp, Elf_Phdr *phdrp, object->phdrc = phdrc; object->load_base = lbase; object->obj_base = obase; + /* XXX */ object->load_name = _dl_strdup(objname); object->load_object = _dl_loading_object; if (object->load_object == object) |