udev_device.c: avoid off-by-one overflow

This commit is contained in:
illiliti
2021-05-26 13:37:02 +03:00
parent 145e2c814f
commit 4b044ae52c

View File

@@ -363,7 +363,9 @@ static void make_bit(unsigned long *arr, int cnt, const char *str)
}
}
arr[i] = strtoul(str, NULL, 16);
if (i < cnt) {
arr[i] = strtoul(str, NULL, 16);
}
}
static int test_bit(unsigned long *arr, unsigned long bit)