Module Name:    src
Committed By:   christos
Date:           Mon Aug 19 23:16:05 UTC 2024

Modified Files:
        src/external/bsd/cron/dist: entry.c

Log Message:
Prevent negative values low and step (Dave G. / Alex Radocea supernetworks)


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/cron/dist/entry.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/cron/dist/entry.c
diff -u src/external/bsd/cron/dist/entry.c:1.11 src/external/bsd/cron/dist/entry.c:1.12
--- src/external/bsd/cron/dist/entry.c:1.11	Sat Apr 18 15:32:19 2020
+++ src/external/bsd/cron/dist/entry.c	Mon Aug 19 19:16:05 2024
@@ -26,7 +26,7 @@
 #if 0
 static char rcsid[] = "Id: entry.c,v 1.17 2004/01/23 18:56:42 vixie Exp";
 #else
-__RCSID("$NetBSD: entry.c,v 1.11 2020/04/18 19:32:19 christos Exp $");
+__RCSID("$NetBSD: entry.c,v 1.12 2024/08/19 23:16:05 christos Exp $");
 #endif
 #endif
 
@@ -519,7 +519,7 @@ get_range(bitstr_t *bits, int low, int h
 
 	if (!star) {
 		ch = get_number(&num1, low, names, ch, file, ",- \t\n");
-		if (ch == EOF)
+		if (ch == EOF || num1 < 0)
 			return (EOF);
 
 		if (ch != '-') {
@@ -579,7 +579,7 @@ get_range(bitstr_t *bits, int low, int h
 		 * sent as a 0 since there is no offset either.
 		 */
 		ch = get_number(&num3, 0, PPC_NULL, ch, file, ", \t\n");
-		if (ch == EOF || num3 == 0)
+		if (ch == EOF || num3 <= 0)
 			return (EOF);
 	} else {
 		/* no step.  default==1.

Reply via email to