mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-30 22:05:46 +00:00
Handle NULL entries in sys_siglist and sys_signame.
This commit is contained in:
@@ -42,7 +42,7 @@ extern const char *const sudo_sys_siglist[NSIG];
|
||||
char *
|
||||
strsignal(int signo)
|
||||
{
|
||||
if (signo > 0 && signo < NSIG)
|
||||
if (signo > 0 && signo < NSIG && sudo_sys_siglist[signo] != NULL)
|
||||
return (char *)sudo_sys_siglist[signo];
|
||||
/* XXX - should be "Unknown signal: %d" */
|
||||
return _("Unknown signal");
|
||||
|
@@ -42,7 +42,7 @@ extern const char *const sudo_sys_signame[NSIG];
|
||||
char *
|
||||
strsigname(int signo)
|
||||
{
|
||||
if (signo > 0 && signo < NSIG)
|
||||
if (signo > 0 && signo < NSIG && sudo_sys_signame[signo] != NULL)
|
||||
return (char *)sudo_sys_signame[signo];
|
||||
/* XXX - should be "Unknown signal: %d" */
|
||||
return _("Unknown signal");
|
||||
|
Reference in New Issue
Block a user