summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-05-10 10:01:00 (GMT)
committerGitHub <noreply@github.com>2024-05-10 10:01:00 (GMT)
commitd524802e9dd624f569948c4c0b6adbe000edcffe (patch)
tree4a7df1554ea38d328bd757ae91e59a89010ca164 /PC
parentb62cb5234be2f43833e52063bf32bff5b2cffc98 (diff)
downloadcpython-d524802e9dd624f569948c4c0b6adbe000edcffe.zip
cpython-d524802e9dd624f569948c4c0b6adbe000edcffe.tar.gz
cpython-d524802e9dd624f569948c4c0b6adbe000edcffe.tar.bz2
Fix some missing null checks. (GH-118721)
(cherry picked from commit 7e6fcab20003b07621dc02ea78d6ea2fda500371) Co-authored-by: Steve Dower <steve.dower@python.org>
Diffstat (limited to 'PC')
-rw-r--r--PC/launcher2.c5
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;