ash: fix 'trap - 65'
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 1 Jul 2017 19:09:27 +0000 (21:09 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 1 Jul 2017 19:09:27 +0000 (21:09 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash.c

index 9681111ccc6efa04eed749dd67d3f5fbcefae3cc..22c726043ea13a0e551698197eab8be49ff4acf1 100644 (file)
@@ -12967,7 +12967,7 @@ trapcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
        exitcode = 0;
        while (*ap) {
                signo = get_signum(*ap);
-               if (signo < 0) {
+               if (signo < 0 || signo >= NSIG) {
                        /* Mimic bash message exactly */
                        ash_msg("%s: invalid signal specification", *ap);
                        exitcode = 1;