From 989e1eec3f8ba6ed47538875a6b8aa0be4d133ea Mon Sep 17 00:00:00 2001 From: Christian Holler Date: Sat, 15 Feb 2014 17:05:00 +0100 Subject: [PATCH] Bug 972951 - Make gcparam only accept positive integers. r=evilpie --- js/src/builtin/TestingFunctions.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index 21c719039a49..502a5d011b02 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -311,7 +311,10 @@ GCParameter(JSContext *cx, unsigned argc, Value *vp) } uint32_t value; - if (!ToUint32(cx, args[1], &value)) { + if (!ToUint32(cx, args[1], &value)) + return false; + + if (!value) { JS_ReportError(cx, "the second argument must be convertable to uint32_t " "with non-zero value"); return false;