Module: wine Branch: master Commit: 140eede67d595e8df034a2265f3c2670b3d69422 URL: http://source.winehq.org/git/wine.git/?a=commit;h=140eede67d595e8df034a2265f...
Author: Hans Leidekker hans@codeweavers.com Date: Thu Oct 29 11:11:38 2009 +0100
ws2_32: Avoid accessing uninitialized memory in GetAddrInfoW.
Found by valgrind.
---
dlls/ws2_32/socket.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 7cf4b96..df9c37d 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -3962,6 +3962,8 @@ int WINAPI GetAddrInfoW(LPCWSTR nodename, LPCWSTR servname, const ADDRINFOW *hin char *nodenameA, *servnameA = NULL; struct WS_addrinfo *resA, *hintsA = NULL;
+ if (!nodename) return WSAHOST_NOT_FOUND; + len = WideCharToMultiByte(CP_ACP, 0, nodename, -1, NULL, 0, NULL, NULL); if (!(nodenameA = HeapAlloc(GetProcessHeap(), 0, len))) return EAI_MEMORY; WideCharToMultiByte(CP_ACP, 0, nodename, -1, nodenameA, len, NULL, NULL);