Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f014487f
Commit
f014487f
authored
Sep 07, 2011
by
Marcus Meissner
Committed by
Alexandre Julliard
Sep 07, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netapi32: Check for GetUserNameW return (Coverity).
parent
354d4168
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
access.c
dlls/netapi32/access.c
+4
-1
local_group.c
dlls/netapi32/local_group.c
+3
-1
No files found.
dlls/netapi32/access.c
View file @
f014487f
...
@@ -437,7 +437,10 @@ NetUserGetLocalGroups(LPCWSTR servername, LPCWSTR username, DWORD level,
...
@@ -437,7 +437,10 @@ NetUserGetLocalGroups(LPCWSTR servername, LPCWSTR username, DWORD level,
size
=
UNLEN
+
1
;
size
=
UNLEN
+
1
;
NetApiBufferAllocate
(
size
*
sizeof
(
WCHAR
),
(
LPVOID
*
)
&
currentuser
);
NetApiBufferAllocate
(
size
*
sizeof
(
WCHAR
),
(
LPVOID
*
)
&
currentuser
);
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
))
{
{
...
...
dlls/netapi32/local_group.c
View file @
f014487f
...
@@ -196,7 +196,9 @@ NET_API_STATUS WINAPI NetLocalGroupGetMembers(
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment