Variables "major" and "indirect" cannot be bigger than "MAX_BLKDEV" because they
are used as array index in "ioconf" and "ioc_refnr" arrays with size "MAX_BLKDEV
+ 1"
/* conventional usage for unsupported device */
continue;
}
- if (indirect >= MAX_BLKDEV) {
+ if (indirect > MAX_BLKDEV) {
fprintf(stderr, "%s: Indirect major #%u out of range\n",
ioconf_name, indirect);
continue;
}
+ if (major > MAX_BLKDEV) {
+ fprintf(stderr, "%s: Major #%u out of range\n",
+ ioconf_name, major);
+ continue;
+ }
if (ioconf[indirect] == NULL) {
fprintf(stderr,
"%s: Indirect record '%u:%u:%u:...'"