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:
Allan Jude 2015-05-18 19:45:46 +00:00
parent 38eb219c75
commit 0db293c171
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=283075

View File

@ -609,7 +609,7 @@ disk_open(char *path)
{
int err, fd;
if (ndisks > NDISKS)
if (ndisks >= NDISKS)
return (ERANGE);
err = 0;