Fix off-by-one in array index bounds check
bhyveload would allow you to create 33 entries on an array that only has 32 slots Differential Revision: https://reviews.freebsd.org/D2569 Reviewed by: araujo Approved by: neel MFC after: 1 week Sponsored by: ScaleEngine Inc.
This commit is contained in:
parent
38eb219c75
commit
0db293c171
@ -609,7 +609,7 @@ disk_open(char *path)
|
|||||||
{
|
{
|
||||||
int err, fd;
|
int err, fd;
|
||||||
|
|
||||||
if (ndisks > NDISKS)
|
if (ndisks >= NDISKS)
|
||||||
return (ERANGE);
|
return (ERANGE);
|
||||||
|
|
||||||
err = 0;
|
err = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user