Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/spt_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ find_argv_from_env(int argc, char *arg0)
}
buf[argc] = NULL;

/* environ can be NULL if clearenv() has been called.
* Python 3.15 implements os.environ.clear() as clearenv(). */
if (!environ) {
spt_debug("environ pointer is NULL");
goto exit;
}

/* Walk back from environ until you find argc-1 null-terminated strings.
* Don't look for argv[0] as it's probably not preceded by 0. */
ptr = environ[0];
Expand Down
Loading