2
0
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:
Todd C. Miller
2012-08-28 09:40:56 -04:00
parent 24991069f6
commit af4f02d3e2
2 changed files with 2 additions and 2 deletions

View File

@@ -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");

View File

@@ -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");