Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Feb 2021 08:37:06 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 560c98ccc897 - stable/12 - rtld: Fix null-pointer dereference
Message-ID:  <202102090837.1198b6sa014150@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=560c98ccc8978c6e6426a6ca6d50a88193ccc600

commit 560c98ccc8978c6e6426a6ca6d50a88193ccc600
Author:     David Chisnall <theraven@FreeBSD.org>
AuthorDate: 2021-02-02 14:06:33 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-02-09 08:36:31 +0000

    rtld: Fix null-pointer dereference
    
    (cherry picked from commit 43d44842aef3972cc86ce673e84e31f372257b15)
---
 libexec/rtld-elf/rtld.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 73177fc0c931..791b50e3cd0e 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -877,8 +877,10 @@ _rtld_bind(Obj_Entry *obj, Elf_Size reloff)
 	target = (Elf_Addr)(defobj->relocbase + def->st_value);
 
     dbg("\"%s\" in \"%s\" ==> %p in \"%s\"",
-      defobj->strtab + def->st_name, basename(obj->path),
-      (void *)target, basename(defobj->path));
+      defobj->strtab + def->st_name,
+      obj->path == NULL ? NULL : basename(obj->path),
+      (void *)target,
+      defobj->path == NULL ? NULL : basename(defobj->path));
 
     /*
      * Write the new contents for the jmpslot. Note that depending on



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102090837.1198b6sa014150>