From fd6afe791c5874078fc2b64785bea1bc0090deda Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Wed, 12 Jul 2006 12:41:56 +0000 Subject: [PATCH] Check that the signal number is in range. Submitted by: maxim MFC after: 1 week Approved by: pjd (mentor) --- usr.bin/kdump/kdump.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index e55e190e1e01..fa2bcc6928e1 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -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 {