diff options
author | Steve Dower <steve.dower@python.org> | 2024-05-10 09:31:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-10 09:31:55 (GMT) |
commit | 7e6fcab20003b07621dc02ea78d6ea2fda500371 (patch) | |
tree | aa8aa59cc3ddc5ed8b3bbbfa8d2dfaa1cf6987fe /PC/launcher2.c | |
parent | 17a2cc199d5d8dd9db49ea596cf243e2217263c6 (diff) | |
download | cpython-7e6fcab20003b07621dc02ea78d6ea2fda500371.zip cpython-7e6fcab20003b07621dc02ea78d6ea2fda500371.tar.gz cpython-7e6fcab20003b07621dc02ea78d6ea2fda500371.tar.bz2 |
Fix some missing null checks. (GH-118721)
Diffstat (limited to 'PC/launcher2.c')
-rw-r--r-- | PC/launcher2.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/PC/launcher2.c b/PC/launcher2.c index 139aa61..9823161 100644 --- a/PC/launcher2.c +++ b/PC/launcher2.c @@ -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; |