Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Sep 2019 20:42:55 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r352045 - stable/12/usr.bin/cpuset
Message-ID:  <201909082042.x88KgtQG040226@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909082042.x88KgtQG040226>