[PATCH 0/1] MR8230: inetmib1: Fix table emptiness check.
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. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8230
From: Yuxuan Shui <yshui(a)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) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8230
participants (2)
-
Yuxuan Shui -
Yuxuan Shui (@yshui)