Fix some missing null checks. (GH-118721)

This commit is contained in:
Steve Dower 2024-05-10 10:31:55 +01:00 committed by GitHub
parent 17a2cc199d
commit 7e6fcab200
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 7 deletions

View file

@ -2707,6 +2707,11 @@ process(int argc, wchar_t ** argv)
DWORD len = GetEnvironmentVariableW(L"PYLAUNCHER_LIMIT_TO_COMPANY", NULL, 0);
if (len > 1) {
wchar_t *limitToCompany = allocSearchInfoBuffer(&search, len);
if (!limitToCompany) {
exitCode = RC_NO_MEMORY;
winerror(0, L"Failed to allocate internal buffer");
goto abort;
}
search.limitToCompany = limitToCompany;
if (0 == GetEnvironmentVariableW(L"PYLAUNCHER_LIMIT_TO_COMPANY", limitToCompany, len)) {
exitCode = RC_INTERNAL_ERROR;