Sec: Fix GetUserNameExA

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2025-01-30 13:40:27 +01:00
parent 034a0ce74f
commit bbe3da0303

View File

@ -35,7 +35,7 @@ static BOOLEAN GetUserNameExA(_In_ EXTENDED_NAME_FORMAT NameFormat, _Inout_ std:
if (::GetLastError() == ERROR_MORE_DATA) { if (::GetLastError() == ERROR_MORE_DATA) {
// Allocate buffer on heap and retry. // Allocate buffer on heap and retry.
sName.resize(ulSize - 1); sName.resize(ulSize - 1);
if (::GetUserNameExA(NameFormat, &ulSize[0], &ulSize)) if (::GetUserNameExA(NameFormat, &sName[0], &ulSize))
return TRUE; return TRUE;
} }
return FALSE; return FALSE;