Check that the signal number is in range.

Submitted by:	maxim
MFC after:	1 week
Approved by:	pjd (mentor)
This commit is contained in:
Konstantin Belousov 2006-07-12 12:41:56 +00:00
parent 3097d55a39
commit fd6afe791c

View File

@ -946,7 +946,10 @@ const char *signames[] = {
void
ktrpsig(struct ktr_psig *psig)
{
(void)printf("SIG%s ", signames[psig->signo]);
if (psig->signo > 0 && psig->signo < NSIG)
(void)printf("SIG%s", signames[psig->signo]);
else
(void)printf("SIG%s ", psig->signo);
if (psig->action == SIG_DFL)
(void)printf("SIG_DFL\n");
else {