summaryrefslogtreecommitdiff
path: root/miniperlmain.c
diff options
context:
space:
mode:
authorTomasz Konojacki <me@xenu.pl>2022-04-19 16:41:23 +0200
committerxenu <me@xenu.pl>2022-05-29 00:54:10 +0200
commitae6b6b71cdbfb3fb6e1192178fa1e530a2f07ece (patch)
tree19d644c0277a598f8f5b2062ef20b43d78591c61 /miniperlmain.c
parentb95d23342a119c6677aa5ad786ca7d002c98bef2 (diff)
downloadperl-ae6b6b71cdbfb3fb6e1192178fa1e530a2f07ece.tar.gz
make PERL_USE_SAFE_PUTENV the default and the only option
Now environ isn't owned by Perl and calling setenv/putenv in XS code will no longer result in memory corruption. Fixes #19399
Diffstat (limited to 'miniperlmain.c')
-rw-r--r--miniperlmain.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/miniperlmain.c b/miniperlmain.c
index 4edd4d1852..d5708c7497 100644
--- a/miniperlmain.c
+++ b/miniperlmain.c
@@ -73,9 +73,6 @@ main(int argc, char **argv, char **env)
#ifndef NO_ENV_ARRAY_IN_MAIN
PERL_UNUSED_ARG(env);
#endif
-#ifndef PERL_USE_SAFE_PUTENV
- PL_use_safe_putenv = FALSE;
-#endif /* PERL_USE_SAFE_PUTENV */
/* if user wants control of gprof profiling off by default */
/* noop unless Configure is given -Accflags=-DPERL_GPROF_CONTROL */
@@ -128,19 +125,6 @@ main(int argc, char **argv, char **env)
perl_free(my_perl);
-#if defined(USE_ENVIRON_ARRAY) && defined(PERL_TRACK_MEMPOOL) && !defined(NO_ENV_ARRAY_IN_MAIN)
- /*
- * The old environment may have been freed by perl_free()
- * when PERL_TRACK_MEMPOOL is defined, but without having
- * been restored by perl_destruct() before (this is only
- * done if destruct_level > 0).
- *
- * It is important to have a valid environment for atexit()
- * routines that are eventually called.
- */
- environ = env;
-#endif
-
PERL_SYS_TERM();
exit(exitstatus);