Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Jul 2007 05:54:09 GMT
From:      Andrew Turner <andrew@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 123086 for review
Message-ID:  <200707080554.l685s9DB037453@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=123086

Change 123086 by andrew@andrew_hermies on 2007/07/08 05:53:54

	When reading past the end of an array return NULL rather then failing an assert

Affected files ...

.. //depot/projects/soc2007/andrew-update/lib/facund_object.c#6 edit

Differences ...

==== //depot/projects/soc2007/andrew-update/lib/facund_object.c#6 (text+ko) ====

@@ -288,7 +288,8 @@
 	assert(obj != NULL);
 	assert(obj->obj_type == FACUND_ARRAY);
 	assert(obj->obj_assigned == 1);
-	assert(pos < obj->obj_array_count);
+	if (pos >= obj->obj_array_count)
+		return NULL;
 
 	obj->obj_error = FACUND_OBJECT_ERROR_NONE;
 	return obj->obj_array[pos];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707080554.l685s9DB037453>