public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] elf: Check objname before calling fatal_error
@ 2024-04-08 16:41 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2024-04-08 16:41 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1cce91d8aed5c3eca2b6f47767c82d9ed3e9e33f

commit 1cce91d8aed5c3eca2b6f47767c82d9ed3e9e33f
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Apr 8 09:06:09 2024 -0700

    elf: Check objname before calling fatal_error
    
    _dl_signal_error may be called with objname == NULL.  _dl_exception_create
    checks objname == NULL.  But fatal_error doesn't.  Check objname before
    calling fatal_error.  This fixes BZ #31596.
    Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>

Diff:
---
 elf/dl-catch.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/elf/dl-catch.c b/elf/dl-catch.c
index 2109516dba..8ef7a4c706 100644
--- a/elf/dl-catch.c
+++ b/elf/dl-catch.c
@@ -126,7 +126,11 @@ _dl_signal_error (int errcode, const char *objname, const char *occasion,
       __longjmp (lcatch->env[0].__jmpbuf, 1);
     }
   else
-    fatal_error (errcode, objname, occasion, errstring);
+    {
+      if (objname == NULL)
+	objname = "";
+      fatal_error (errcode, objname, occasion, errstring);
+    }
 }
 rtld_hidden_def (_dl_signal_error)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-08 16:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-08 16:41 [glibc] elf: Check objname before calling fatal_error H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).