From 1cd14caf5674995589dacf105eee05b8e15814bc Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 13 Feb 2006 15:15:05 +0000 Subject: [PATCH] added additional sanity check to index call git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@637 9efc2488-bf62-4759-914b-345cdb29e865 --- src/objson/object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/objson/object.c b/src/objson/object.c index fdd2c58..5d73642 100644 --- a/src/objson/object.c +++ b/src/objson/object.c @@ -345,7 +345,8 @@ void jsonObjectNodeFree( jsonObjectNode* node ) { jsonObject* jsonObjectGetIndex( const jsonObject* obj, unsigned long index ) { - if( obj && index >= 0 && obj->type == JSON_ARRAY ) { + if( obj && index >= 0 && + index < obj->size && obj->type == JSON_ARRAY ) { jsonObjectNode* node = obj->value.c; while(node) { -- 2.43.2