Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit a3faf9d9 authored by rswindell's avatar rswindell

js_CreateEnvObject() "roots" array before defining elements (prevent premature

GC).
parent f80a2267
...@@ -404,6 +404,10 @@ static BOOL js_CreateEnvObject(JSContext* cx, JSObject* glob, char** env) ...@@ -404,6 +404,10 @@ static BOOL js_CreateEnvObject(JSContext* cx, JSObject* glob, char** env)
if((js_env=JS_NewObject(js_cx, NULL, NULL, glob))==NULL) if((js_env=JS_NewObject(js_cx, NULL, NULL, glob))==NULL)
return(FALSE); return(FALSE);
if(!JS_DefineProperty(cx, glob, "env", OBJECT_TO_JSVAL(js_env)
,NULL,NULL,JSPROP_READONLY|JSPROP_ENUMERATE))
return(FALSE);
for(i=0;env[i]!=NULL;i++) { for(i=0;env[i]!=NULL;i++) {
SAFECOPY(name,env[i]); SAFECOPY(name,env[i]);
truncstr(name,"="); truncstr(name,"=");
...@@ -417,10 +421,6 @@ static BOOL js_CreateEnvObject(JSContext* cx, JSObject* glob, char** env) ...@@ -417,10 +421,6 @@ static BOOL js_CreateEnvObject(JSContext* cx, JSObject* glob, char** env)
return(FALSE); return(FALSE);
} }
if(!JS_DefineProperty(cx, glob, "env", OBJECT_TO_JSVAL(js_env)
,NULL,NULL,JSPROP_READONLY|JSPROP_ENUMERATE))
return(FALSE);
return(TRUE); return(TRUE);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment