summaryrefslogtreecommitdiffstats
path: root/src/H5FL.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2007-01-03 17:48:51 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2007-01-03 17:48:51 (GMT)
commit11af96e8677f8d22a3bacb745eee09576fdb9eec (patch)
tree1372985494999cf48ceb1b397e2f2271e518c85f /src/H5FL.c
parentb5a2e7c634b438c3681b8c40c3fd8e9ab7d3e442 (diff)
downloadhdf5-11af96e8677f8d22a3bacb745eee09576fdb9eec.zip
hdf5-11af96e8677f8d22a3bacb745eee09576fdb9eec.tar.gz
hdf5-11af96e8677f8d22a3bacb745eee09576fdb9eec.tar.bz2
[svn-r13102] Found a bug: shared message list sizes above the maximum were not caught.
Fixed bug and a related one where the number of indexes could be set above the maximum. Added tests for both bugs. Tested on kagiso and smirom.
Diffstat (limited to 'src/H5FL.c')
-rw-r--r--src/H5FL.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/H5FL.c b/src/H5FL.c
index e75078f..7a20d28 100644
--- a/src/H5FL.c
+++ b/src/H5FL.c
@@ -1503,12 +1503,12 @@ H5FL_arr_malloc(H5FL_arr_head_t *head, size_t elem)
if(H5FL_arr_init(head)<0)
HGOTO_ERROR (H5E_RESOURCE, H5E_CANTINIT, NULL, "can't initialize 'array' blocks")
+ /* Sanity check that the number of elements is supported */
+ assert(elem<=(unsigned) head->maxelem);
+
/* Get the set of the memory block */
mem_size=head->list_arr[elem].size;
- /* Sanity check that the number of elements is supported */
- assert((int)elem<=head->maxelem);
-
/* Check for nodes available on the free list first */
if(head->list_arr[elem].list!=NULL) {
/* Get a pointer to the block on the free list */