From 4d59cc85e80d021c95e000553fcfaf02bdfc1b9e Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sat, 28 Mar 2009 15:54:08 +0000 Subject: [PATCH] Do not dereference NULL pointer. refobj is NULL for the objects that are preloaded. Reported and tested by: ed --- libexec/rtld-elf/rtld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 823427a579c..d98ade7ce25 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -1125,7 +1125,7 @@ find_library(const char *xname, const Obj_Entry *refobj) xname); return NULL; } - if (refobj->z_origin) + if (refobj != NULL && refobj->z_origin) return origin_subst(xname, refobj->origin_path); else return xstrdup(xname);