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,7 +126,11 @@ _dl_signal_error (int errcode, const char *objname, const char *occasion,
__longjmp (lcatch->env[0].__jmpbuf, 1); __longjmp (lcatch->env[0].__jmpbuf, 1);
} }
else else
fatal_error (errcode, objname, occasion, errstring); {
if (objname == NULL)
objname = "";
fatal_error (errcode, objname, occasion, errstring);
}
} }
rtld_hidden_def (_dl_signal_error) rtld_hidden_def (_dl_signal_error)