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
df7b2ed737
commit
906e73af39
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user