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:
parent
2cd91f9768
commit
89fc7d80c4
@ -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);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user