Skip to content
Snippets Groups Projects
Commit b84dd99b authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Scripts assume that calling user.compare_ars(undefined) will not throw

... an exception (e.g. chat_sec.js), so return false instead.

This fixes issue #864

Thank you Accession and Nelgin for the report
parent 3641b88f
No related branches found
No related tags found
No related merge requests found
Pipeline #7907 passed
......@@ -4,7 +4,7 @@
var func_list = {
'adjust_credits': 1,
'adjust_minutes': 1,
'compare_ars': 1,
'compare_ars': 0,
'downloaded_file': 1,
'get_time_left': 1,
'posted_message': 1,
......
......@@ -4,6 +4,7 @@ var type = {
'adjust_credits(0)' : 'boolean',
'adjust_minutes(0)' : 'boolean',
'compare_ars("")' : 'boolean',
'compare_ars(undefined)' : 'boolean',
'downloaded_file()' : 'boolean',
'get_time_left(0)' : 'number',
'posted_message(0)' : 'boolean',
......
......@@ -1074,8 +1074,10 @@ js_chk_ar(JSContext *cx, uintN argc, jsval *arglist)
if (js_argcIsInsufficient(cx, argc, 1))
return JS_FALSE;
if (js_argvIsNullOrVoid(cx, argv, 0))
return JS_FALSE;
if (JSVAL_NULL_OR_VOID(argv[0])) {
JS_SET_RVAL(cx, arglist, JSVAL_TRUE);
return JS_TRUE;
}
scfg = JS_GetRuntimePrivate(JS_GetRuntime(cx));
......
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