Bug 649939: Prevent crash from too much recursion in Iterator.prototype.next() (r=jwalden)

This commit is contained in:
Paul Biggar
2011-06-16 17:00:31 -07:00
parent f7f2c53b67
commit bdf9c3457d
4 changed files with 33 additions and 2 deletions

View File

@@ -942,6 +942,9 @@ js_IteratorMore(JSContext *cx, JSObject *iterobj, Value *rval)
return true;
}
/* We're reentering below and can call anything. */
JS_CHECK_RECURSION(cx, return false);
/* Fetch and cache the next value from the iterator. */
if (!ni) {
jsid id = ATOM_TO_JSID(cx->runtime->atomState.nextAtom);