Bug 972951 - Make gcparam only accept positive integers. r=evilpie

This commit is contained in:
Christian Holler 2014-02-15 17:05:00 +01:00
parent 783858dcf1
commit 120a062b6e

View File

@ -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;