Stefan Dösinger : iphlpapi: Write an ERR if the sockaddr parsing went wrong.
Alexandre Julliard
julliard at winehq.org
Wed Apr 22 15:29:28 CDT 2020
Module: wine
Branch: master
Commit: 7f4beb0883172a1629926e070fc6d5b6fab05922
URL: https://source.winehq.org/git/wine.git/?a=commit;h=7f4beb0883172a1629926e070fc6d5b6fab05922
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Sun Apr 12 14:24:55 2020 +0200
iphlpapi: Write an ERR if the sockaddr parsing went wrong.
It should not happen any more after the previous patch but it is subtle
enough that I think being verbose about it makes sense.
Signed-off-by: Stefan Dösinger <stefan at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/iphlpapi/ipstats.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
index 6986a4b315..9d6a84dd33 100644
--- a/dlls/iphlpapi/ipstats.c
+++ b/dlls/iphlpapi/ipstats.c
@@ -1539,6 +1539,12 @@ DWORD WINAPI AllocateAndGetIpForwardTableFromStack(PMIB_IPFORWARDTABLE *ppIpForw
continue;
sa = (struct sockaddr *)addrPtr;
+ if (addrPtr + sa->sa_len > next + rtm->rtm_msglen)
+ {
+ ERR ("struct sockaddr extends beyond the route message, %p > %p\n",
+ addrPtr + sa->sa_len, next + rtm->rtm_msglen );
+ }
+
ADVANCE (addrPtr, sa);
/* default routes are encoded by length-zero sockaddr */
More information about the wine-cvs
mailing list