Commit 140eede6 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

ws2_32: Avoid accessing uninitialized memory in GetAddrInfoW.

Found by valgrind.
parent 5e18596f
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment