From f4dbcb51ff1ff0522b36d9c31504bb41d6ad8d67 Mon Sep 17 00:00:00 2001 From: deuce <> Date: Mon, 17 Oct 2011 22:08:31 +0000 Subject: [PATCH] Call strdup() on the new environment string to ensure it doesn't change at a later date. --- src/sbbs3/jsexec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sbbs3/jsexec.c b/src/sbbs3/jsexec.c index dfa2f8cfe6..1323e78d38 100644 --- a/src/sbbs3/jsexec.c +++ b/src/sbbs3/jsexec.c @@ -607,7 +607,7 @@ js_putenv(JSContext *cx, uintN argc, jsval *arglist) return(JS_TRUE); } - JS_SET_RVAL(cx, arglist, BOOLEAN_TO_JSVAL(putenv(p)==0)); + JS_SET_RVAL(cx, arglist, BOOLEAN_TO_JSVAL(putenv(strdup(p))==0)); return(JS_TRUE); } -- GitLab