Set lpnSize when insufficient
This commit is contained in:
parent
edcb8b0402
commit
876a88c7d8
1 changed files with 1 additions and 0 deletions
|
@ -80,6 +80,7 @@ BOOL GetUserName(WCHAR_T *lpBuffer, LPDWORD lpnSize)
|
|||
|
||||
if (output.size()/2 + 1 > *lpnSize) {
|
||||
errno = ERROR_INSUFFICIENT_BUFFER;
|
||||
*lpnSize = output.size()/2 + 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue