windows: fix buffer overflow on uv__getnameinfo_work()

According to
http://msdn.microsoft.com/en-us/library/windows/desktop/ms738531.aspx,
"NodeBufferSize" and "ServiceBufferSize" parameters of GetNameInfoW()
function are expected to represent the number of WCHAR, not the buffer size
of memory layout.
This commit is contained in:
lilohuang 2014-08-03 16:28:40 +08:00 committed by Saúl Ibarra Corretgé
parent 2cd91f9768
commit 89fc7d80c4

View File

@ -49,9 +49,9 @@ static void uv__getnameinfo_work(struct uv__work* w) {
ret = GetNameInfoW((struct sockaddr*)&req->storage,
sizeof(req->storage),
host,
sizeof(host),
ARRAY_SIZE(host),
service,
sizeof(service),
ARRAY_SIZE(service),
req->flags);
req->retcode = uv__getaddrinfo_translate_error(ret);