Followup fix for bug 368945. Adding missing argc check to make sure we don't poke past the end of the arguments. r+sr=shaver@mozilla.org

This commit is contained in:
jst%mozilla.org 2007-02-27 02:00:13 +00:00
Родитель 2794c33402
Коммит 0d13829eab
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -549,6 +549,12 @@ JS_STATIC_DLL_CALLBACK(JSBool)
XPC_SJOW_CallWrapper(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
jsval *rval)
{
// Make sure we've got at least one argument (which may not be the
// case if someone's monkeying with this function directly from JS).
if (argc < 1) {
return ThrowException(NS_ERROR_INVALID_ARG, cx);
}
return ::JS_CallFunctionValue(cx, obj, argv[0], argc - 1, argv + 1, rval);
}