https://git.reactos.org/?p=reactos.git;a=commitdiff;h=da4e15f93aa1337890907…
commit da4e15f93aa1337890907f06e87419d4cc70e918
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Mon Oct 25 00:36:03 2021 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Mon Oct 25 00:36:03 2021 +0200
[IPHLPAPI] Check the family parameter in the statistics functions
---
dll/win32/iphlpapi/ipstats_reactos.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/dll/win32/iphlpapi/ipstats_reactos.c b/dll/win32/iphlpapi/ipstats_reactos.c
index a1214926a72..b3cda7eb64a 100644
--- a/dll/win32/iphlpapi/ipstats_reactos.c
+++ b/dll/win32/iphlpapi/ipstats_reactos.c
@@ -179,7 +179,7 @@ NTSTATUS tdiGetIpAddrsForIpEntity
INFO_TYPE_PROVIDER,
IP_MIB_ADDRTABLE_ENTRY_ID,
CL_NL_ENTITY,
- ent->tei_instance,
+ ent->tei_instance,
0,
sizeof(IPAddrEntry),
(PVOID *)addrs,
@@ -334,6 +334,10 @@ DWORD getIPStats(PMIB_IPSTATS stats, DWORD family)
{
if (!stats)
return ERROR_INVALID_PARAMETER;
+
+ if (family != AF_INET && family != AF_INET6)
+ return ERROR_INVALID_PARAMETER;
+
return NO_ERROR;
}
@@ -341,6 +345,10 @@ DWORD getTCPStats(MIB_TCPSTATS *stats, DWORD family)
{
if (!stats)
return ERROR_INVALID_PARAMETER;
+
+ if (family != AF_INET && family != AF_INET6)
+ return ERROR_INVALID_PARAMETER;
+
return NO_ERROR;
}
@@ -348,6 +356,10 @@ DWORD getUDPStats(MIB_UDPSTATS *stats, DWORD family)
{
if (!stats)
return ERROR_INVALID_PARAMETER;
+
+ if (family != AF_INET && family != AF_INET6)
+ return ERROR_INVALID_PARAMETER;
+
return NO_ERROR;
}