changeset 57:10996c267de4

loadtools old buglet: off by 1 error in the max-arguments logic in cmd parsing
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 24 Jun 2013 05:24:19 +0000
parents d98137625c0d
children 1f9302b6f342
files loadtools/initscript.c loadtools/ltdispatch.c
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/loadtools/initscript.c	Sun Jun 23 20:50:41 2013 +0000
+++ b/loadtools/initscript.c	Mon Jun 24 05:24:19 2013 +0000
@@ -69,7 +69,7 @@
 			cp++;
 		if (!*cp || *cp == '#')
 			break;
-		if (ap - argv - 1 > tp->maxargs) {
+		if (ap - argv - 1 >= tp->maxargs) {
 			fprintf(stderr, "error: too many arguments\n");
 			return(-1);
 		}
--- a/loadtools/ltdispatch.c	Sun Jun 23 20:50:41 2013 +0000
+++ b/loadtools/ltdispatch.c	Mon Jun 24 05:24:19 2013 +0000
@@ -69,7 +69,7 @@
 			cp++;
 		if (!*cp || *cp == '#')
 			break;
-		if (ap - argv - 1 > tp->maxargs) {
+		if (ap - argv - 1 >= tp->maxargs) {
 			fprintf(stderr, "error: too many arguments\n");
 			return(-1);
 		}