[IPHLPAPI] Fix broken size computation leading to buffer overrun

This commit is contained in:
Pierre Schweitzer 2018-11-27 22:57:30 +01:00
parent 559297fe81
commit 159f5b676a
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -1015,7 +1015,7 @@ PMIB_TCPTABLE_OWNER_MODULE getOwnerModTcpTable(void)
IpOwnerModTcpTable = HeapAlloc IpOwnerModTcpTable = HeapAlloc
( GetProcessHeap(), 0, ( GetProcessHeap(), 0,
sizeof(DWORD) + (sizeof(PMIB_TCPROW_OWNER_MODULE) * totalNumber) ); sizeof(DWORD) + (sizeof(MIB_TCPROW_OWNER_MODULE) * totalNumber) );
if (!IpOwnerModTcpTable) { if (!IpOwnerModTcpTable) {
closeTcpFile(tcpFile); closeTcpFile(tcpFile);
return NULL; return NULL;
@ -1034,7 +1034,7 @@ PMIB_TCPTABLE_OWNER_MODULE getOwnerModTcpTable(void)
CO_TL_ENTITY, CO_TL_ENTITY,
entitySet[i].tei_instance, entitySet[i].tei_instance,
0, 0,
sizeof(PMIB_TCPROW_OWNER_MODULE), sizeof(MIB_TCPROW_OWNER_MODULE),
(PVOID *)&AdapterOwnerModTcpTable, (PVOID *)&AdapterOwnerModTcpTable,
&returnSize ); &returnSize );