From: erickson Date: Mon, 13 Feb 2006 15:15:05 +0000 (+0000) Subject: added additional sanity check to index call X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1cd14caf5674995589dacf105eee05b8e15814bc;p=working%2FOpenSRF.git added additional sanity check to index call git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@637 9efc2488-bf62-4759-914b-345cdb29e865 --- 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) {