From: Yuxuan Shui yshui@codeweavers.com
getItemAndInstanceFromTable only checks if the table is NULL, but didn't check if it actually contains any entries. It just assumes it does and will return index 1 in some cases, resulting in out-of-bound access of the table down the line. --- dlls/inetmib1/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/inetmib1/main.c b/dlls/inetmib1/main.c index 6a662c2f72a..2f9679148b8 100644 --- a/dlls/inetmib1/main.c +++ b/dlls/inetmib1/main.c @@ -413,7 +413,7 @@ static AsnInteger32 getItemAndInstanceFromTable(AsnObjectIdentifier *oid, { AsnInteger32 ret = SNMP_ERRORSTATUS_NOERROR;
- if (!table) + if (!table || !table->numEntries) return SNMP_ERRORSTATUS_NOSUCHNAME;
switch (bPduType)