mirror of
https://github.com/reactos/wine.git
synced 2025-02-18 03:48:01 +00:00
netapi32: Check for GetUserNameW return (Coverity).
This commit is contained in:
parent
354d41685f
commit
f014487f9e
@ -437,7 +437,10 @@ NetUserGetLocalGroups(LPCWSTR servername, LPCWSTR username, DWORD level,
|
|||||||
|
|
||||||
size = UNLEN + 1;
|
size = UNLEN + 1;
|
||||||
NetApiBufferAllocate(size * sizeof(WCHAR), (LPVOID*)¤tuser);
|
NetApiBufferAllocate(size * sizeof(WCHAR), (LPVOID*)¤tuser);
|
||||||
GetUserNameW(currentuser, &size);
|
if (!GetUserNameW(currentuser, &size)) {
|
||||||
|
NetApiBufferFree(currentuser);
|
||||||
|
return ERROR_NOT_ENOUGH_MEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
if (lstrcmpiW(username, currentuser) && NETAPI_FindUser(username))
|
if (lstrcmpiW(username, currentuser) && NETAPI_FindUser(username))
|
||||||
{
|
{
|
||||||
|
@ -196,7 +196,9 @@ NET_API_STATUS WINAPI NetLocalGroupGetMembers(
|
|||||||
*entriesread = 0;
|
*entriesread = 0;
|
||||||
|
|
||||||
userNameLen = MAX_COMPUTERNAME_LENGTH + 1;
|
userNameLen = MAX_COMPUTERNAME_LENGTH + 1;
|
||||||
GetUserNameW(userName,&userNameLen);
|
if (!GetUserNameW(userName,&userNameLen))
|
||||||
|
return ERROR_NOT_ENOUGH_MEMORY;
|
||||||
|
|
||||||
needlen = sizeof(LOCALGROUP_MEMBERS_INFO_3) +
|
needlen = sizeof(LOCALGROUP_MEMBERS_INFO_3) +
|
||||||
(userNameLen+2) * sizeof(WCHAR);
|
(userNameLen+2) * sizeof(WCHAR);
|
||||||
if (prefmaxlen != MAX_PREFERRED_LENGTH)
|
if (prefmaxlen != MAX_PREFERRED_LENGTH)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user