1
1

make sure not to go out of bounds. element i+1 of bml_btls

is referenced, which for i-arr_size-1 is beyond the array dimentions.

This commit was SVN r14464.
Этот коммит содержится в:
Rich Graham 2007-04-22 21:43:34 +00:00
родитель cf3f41288b
Коммит ce35761683

Просмотреть файл

@ -155,7 +155,8 @@ static inline bool mca_bml_base_btl_array_remove( mca_bml_base_btl_array_t* arra
/* find the btl */
for( i = 0; i < array->arr_size; i++ ) {
if( array->bml_btls[i].btl == btl ) {
for( ; i < array->arr_size; i++ ) {
/* make sure not to go out of bounds */
for( ; i < array->arr_size-1; i++ ) {
/* move all btl's back by 1, so the found
btl is "removed" */
array->bml_btls[i] = array->bml_btls[(i+1)];