]> granicus.if.org Git - procps-ng/commitdiff
0041-proc/sig.c: Harden print_given_signals().
authorQualys Security Advisory <qsa@qualys.com>
Thu, 1 Jan 1970 00:00:00 +0000 (00:00 +0000)
committerCraig Small <csmall@enc.com.au>
Sat, 9 Jun 2018 11:35:19 +0000 (21:35 +1000)
And signal_name_to_number().

---------------------------- adapted for newlib branch
. file has been moved to: lib/signals.c
. only 'signal_name_to_number()' was impacted
. function 'print_given_signals()' no longer exists
. thus the bulk of original patch no longer applicable

Signed-off-by: Jim Warner <james.warner@comcast.net>
lib/signals.c

index 6074d6a33f5eccea6caa9f9fbabbcc8a7b6d8279..caff420d300c553302fa49ca0282650a1712b595 100644 (file)
@@ -200,7 +200,7 @@ int signal_name_to_number(const char *restrict name){
         if(*endp || endp==name)
             return -1; /* not valid */
     }
-    if(val+SIGRTMIN>127)
+    if(val<0 || val+SIGRTMIN>127)
         return -1; /* not valid */
     return val+offset;
 }