diff options
author | James Laird <jlaird@hdfgroup.org> | 2007-01-03 17:48:51 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2007-01-03 17:48:51 (GMT) |
commit | 11af96e8677f8d22a3bacb745eee09576fdb9eec (patch) | |
tree | 1372985494999cf48ceb1b397e2f2271e518c85f /src/H5FL.c | |
parent | b5a2e7c634b438c3681b8c40c3fd8e9ab7d3e442 (diff) | |
download | hdf5-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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 */ |