From 44a94685f3d635fa9f7b3f7ece99943e5577614f Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sat, 24 Oct 2015 13:47:03 +0000 Subject: [PATCH] timeout(1): fix the acceptable range values for parse_signal() Before both 0 and sys_nsig would be successfully returned by parse_signal() although being invalid signal numbers. PR: Alexandre Perrin MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D3990 --- usr.bin/timeout/timeout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/timeout/timeout.c b/usr.bin/timeout/timeout.c index a682dde19164..804efd8131f6 100644 --- a/usr.bin/timeout/timeout.c +++ b/usr.bin/timeout/timeout.c @@ -105,7 +105,7 @@ parse_signal(const char *str) int sig, i; const char *errstr; - sig = strtonum(str, 0, sys_nsig, &errstr); + sig = strtonum(str, 1, sys_nsig - 1, &errstr); if (errstr == NULL) return (sig);