From 1cce91d8aed5c3eca2b6f47767c82d9ed3e9e33f Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 8 Apr 2024 09:06:09 -0700 Subject: [PATCH] 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 --- 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)