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>
This commit is contained in:
H.J. Lu 2024-04-08 09:06:09 -07:00
parent 727aacfd66
commit 1cce91d8ae

View File

@ -126,8 +126,12 @@ _dl_signal_error (int errcode, const char *objname, const char *occasion,
__longjmp (lcatch->env[0].__jmpbuf, 1);
}
else
{
if (objname == NULL)
objname = "";
fatal_error (errcode, objname, occasion, errstring);
}
}
rtld_hidden_def (_dl_signal_error)
#if IS_IN (rtld)