From 8ab4d8edad246af2914519ca7545e92b96a27904 Mon Sep 17 00:00:00 2001 From: kan Date: Tue, 21 Aug 2012 22:42:46 +0000 Subject: [PATCH] MFC r239470: Do not call process_nodelete with NULL object pointer. The place where the function is called can be reached if object loading and relocation fails too, in which case obj pointer will be NULL. Do not call process_nodelete then, or crash will follow. Pointy hat to: kan Approved by: re (kib) git-svn-id: svn://svn.freebsd.org/base/releng/9.1@239546 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- libexec/rtld-elf/rtld.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 77079a56..e6298cc4 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -2698,7 +2698,8 @@ dlopen_object(const char *name, int fd, Obj_Entry *refobj, int lo_flags, * This has to be done after we have loaded all of the * dependencies, so that we do not miss any. */ - process_nodelete(obj); + if (obj != NULL) + process_nodelete(obj); } else { /* * Bump the reference counts for objects on this DAG. If -- 2.45.0