oce(4): potential out of bounds access before vector validation

Submitted by:	Augustin Cavalier <waddlesplash@gmail.com>
Obtained from:	Haiku (ec2b89264cfc63e05e611cce82cc449197403aa4)
MFC after:	3 days
This commit is contained in:
Kyle Evans 2019-08-06 13:09:20 +00:00
parent 12b678e9f2
commit ab7de25c25
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=350630

View File

@ -836,12 +836,14 @@ oce_fast_isr(void *arg)
static int
oce_alloc_intr(POCE_SOFTC sc, int vector, void (*isr) (void *arg, int pending))
{
POCE_INTR_INFO ii = &sc->intrs[vector];
POCE_INTR_INFO ii;
int rc = 0, rr;
if (vector >= OCE_MAX_EQ)
return (EINVAL);
ii = &sc->intrs[vector];
/* Set the resource id for the interrupt.
* MSIx is vector + 1 for the resource id,
* INTx is 0 for the resource id.