--- sysvinit-2.96/src/shutdown.c.org 2020-02-24 14:20:54.265362805 +0100 +++ sysvinit-2.96/src/shutdown.c 2020-02-27 10:24:16.865892277 +0100 @@ -778,16 +778,18 @@ int main(int argc, char **argv) if (!strcmp(when, "now")) strcpy(when, "0"); sp = when; - if (when[0] == '+') sp++; - /* Decode shutdown time. */ + /* Validate time argument. */ for ( ; *sp; sp++) { - if (*sp != ':' && (*sp < '0' || *sp > '9')) + if (*sp != '+' && *sp != ':' && (*sp < '0' || *sp > '9')) usage(); } + sp = when; + /* Decode shutdown time. */ + if (when[0] == '+') sp++; if (strchr(when, ':') == NULL) { /* Time in minutes. */ - wt = atoi(when); - if (wt == 0 && when[0] != '0') usage(); + wt = atoi(sp); + if (wt == 0 && sp[0] != '0') usage(); } else { /* Time in hh:mm format. */ if (sscanf(when, "%d:%2d", &hours, &mins) != 2) usage();