From 8f7dcbe4796a89e8bb81926166d01287f85c2922 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sun, 24 May 2020 02:35:13 +0000 Subject: [PATCH] fixed to clear environment variables when clearenv() is not available --- mio/lib/http-svr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mio/lib/http-svr.c b/mio/lib/http-svr.c index a7c63f7..e901591 100644 --- a/mio/lib/http-svr.c +++ b/mio/lib/http-svr.c @@ -1282,7 +1282,10 @@ static int cgi_peer_on_fork (mio_dev_pro_t* pro, void* fork_ctx) #if defined(HAVE_CLEARENV) clearenv (); #else - putenv ("environ=NULL"); + { + extern char** environ; + if (environ) environ[0] = '\0'; + } #endif if (path) setenv ("PATH", path, 1); if (lang) setenv ("LANG", lang, 1);