Skip to content
Snippets Groups Projects
Commit a116fbda authored by rswindell's avatar rswindell
Browse files

More paranoia in js_load().

parent 7adc5d2b
No related branches found
No related tags found
No related merge requests found
......@@ -347,15 +347,16 @@ js_load(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
SAFECOPY(path,filename);
else {
path[0]=0;
if(JS_GetProperty(cx, obj, "js", &val) && JSVAL_IS_OBJECT(val)) {
if(JS_GetProperty(cx, obj, "js", &val) && val!=JSVAL_VOID && JSVAL_IS_OBJECT(val)) {
JSObject* js = JSVAL_TO_OBJECT(val);
if(JS_GetProperty(cx, js, "exec_dir", &val) && JSVAL_IS_STRING(val)) {
if(JS_GetProperty(cx, js, "exec_dir", &val) && val!=JSVAL_VOID && JSVAL_IS_STRING(val)) {
SAFEPRINTF2(path,"%s%s",js_ValueToStringBytes(cx, val, NULL),filename);
if(!fexistcase(path))
path[0]=0;
}
if(path[0]==0
&& JS_GetProperty(cx, js, JAVASCRIPT_LOAD_PATH_LIST, &val)
&& val!=JSVAL_VOID
&& JSVAL_IS_OBJECT(val)) {
JSObject* list = JSVAL_TO_OBJECT(val);
jsuint i;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment