Fix an off-by-one bug in the CPU and domain ID parser.
The "size" parameter is the size of the corresponding bit set, so the maximum CPU or domain index is size - 1. MFC after: 1 week
This commit is contained in:
parent
9ae631858e
commit
c993b95329
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=351671
@ -100,10 +100,10 @@ parselist(char *list, struct bitset *mask, int size)
|
|||||||
for (l = list; *l != '\0';) {
|
for (l = list; *l != '\0';) {
|
||||||
if (isdigit(*l)) {
|
if (isdigit(*l)) {
|
||||||
curnum = atoi(l);
|
curnum = atoi(l);
|
||||||
if (curnum > size)
|
if (curnum >= size)
|
||||||
errx(EXIT_FAILURE,
|
errx(EXIT_FAILURE,
|
||||||
"List entry %d exceeds maximum of %d",
|
"List entry %d exceeds maximum of %d",
|
||||||
curnum, size);
|
curnum, size - 1);
|
||||||
while (isdigit(*l))
|
while (isdigit(*l))
|
||||||
l++;
|
l++;
|
||||||
switch (state) {
|
switch (state) {
|
||||||
|
Loading…
Reference in New Issue
Block a user