Module: wine Branch: master Commit: 51e77324dd486484948cce4cb58039d8c93b51dd URL: http://source.winehq.org/git/wine.git/?a=commit;h=51e77324dd486484948cce4cb5...
Author: Piotr Caban piotr@codeweavers.com Date: Fri May 8 18:01:58 2015 +0200
ws2_32: Fix ai_canonname buffer allocation in addrinfo_AtoW.
---
dlls/ws2_32/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 10bfd9d..ac81d24 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -6120,7 +6120,7 @@ static struct WS_addrinfoW *addrinfo_AtoW(const struct WS_addrinfo *ai) if (ai->ai_canonname) { int len = MultiByteToWideChar(CP_ACP, 0, ai->ai_canonname, -1, NULL, 0); - if (!(ret->ai_canonname = HeapAlloc(GetProcessHeap(), 0, len))) + if (!(ret->ai_canonname = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)))) { HeapFree(GetProcessHeap(), 0, ret); return NULL;