From 26766defe77775c10b03abe8fcb44c40bee8d5f8 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sun, 27 May 2007 19:18:44 +0300 Subject: [PATCH] SMJS: Assert that form_number of input_class is in range. --- src/ecmascript/spidermonkey/form.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ecmascript/spidermonkey/form.c b/src/ecmascript/spidermonkey/form.c index 7f3cc77a8..0c220c3f3 100644 --- a/src/ecmascript/spidermonkey/form.c +++ b/src/ecmascript/spidermonkey/form.c @@ -138,6 +138,9 @@ input_get_form_state(JSContext *ctx, JSObject *obj, struct view_state *vs) (JSClass *) &input_class, NULL); + assert(n >= 0); + assert(n < vs->form_info_len); + if_assert_failed return NULL; return &vs->form_info[n]; }