svn commit: r352045 - stable/12/usr.bin/cpuset

Mark Johnston markj at FreeBSD.org
Sun Sep 8 20:42:56 UTC 2019


Author: markj
Date: Sun Sep  8 20:42:55 2019
New Revision: 352045
URL: https://svnweb.freebsd.org/changeset/base/352045

Log:
  MFC r351671:
  Fix an off-by-one bug in the CPU and domain ID parser.

Modified:
  stable/12/usr.bin/cpuset/cpuset.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/cpuset/cpuset.c
==============================================================================
--- stable/12/usr.bin/cpuset/cpuset.c	Sun Sep  8 20:42:28 2019	(r352044)
+++ stable/12/usr.bin/cpuset/cpuset.c	Sun Sep  8 20:42:55 2019	(r352045)
@@ -100,10 +100,10 @@ parselist(char *list, struct bitset *mask, int size)
 	for (l = list; *l != '\0';) {
 		if (isdigit(*l)) {
 			curnum = atoi(l);
-			if (curnum > size)
+			if (curnum >= size)
 				errx(EXIT_FAILURE,
 				    "List entry %d exceeds maximum of %d",
-				    curnum, size);
+				    curnum, size - 1);
 			while (isdigit(*l))
 				l++;
 			switch (state) {


More information about the svn-src-all mailing list