win: fix buffer size in uv__getpwuid_r()
PR-URL: https://github.com/libuv/libuv/pull/1467 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
This commit is contained in:
parent
0b41b0ad39
commit
832ab902cf
@ -1388,7 +1388,7 @@ int uv__getpwuid_r(uv_passwd_t* pwd) {
|
||||
if (OpenProcessToken(GetCurrentProcess(), TOKEN_READ, &token) == 0)
|
||||
return uv_translate_sys_error(GetLastError());
|
||||
|
||||
bufsize = sizeof(path);
|
||||
bufsize = ARRAY_SIZE(path);
|
||||
if (!GetUserProfileDirectoryW(token, path, &bufsize)) {
|
||||
r = GetLastError();
|
||||
CloseHandle(token);
|
||||
@ -1403,7 +1403,7 @@ int uv__getpwuid_r(uv_passwd_t* pwd) {
|
||||
CloseHandle(token);
|
||||
|
||||
/* Get the username using GetUserNameW() */
|
||||
bufsize = sizeof(username);
|
||||
bufsize = ARRAY_SIZE(username);
|
||||
if (!GetUserNameW(username, &bufsize)) {
|
||||
r = GetLastError();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user