added additional sanity check to index call
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 13 Feb 2006 15:15:05 +0000 (15:15 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 13 Feb 2006 15:15:05 +0000 (15:15 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3037 dcc99617-32d9-48b4-a31d-7c20da2025e4

OpenSRF/src/objson/object.c

index fdd2c58..5d73642 100644 (file)
@@ -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) {