From dc8e8b2f1451fba28b0f4b06e26ba1feacb54ef1 Mon Sep 17 00:00:00 2001 From: kan Date: Mon, 20 Aug 2012 23:47:24 +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 git-svn-id: svn://svn.freebsd.org/base/stable/9@239471 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 77079a568..e6298cc4a 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