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.
Этот коммит содержится в:
родитель
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 */
|
/* find the btl */
|
||||||
for( i = 0; i < array->arr_size; i++ ) {
|
for( i = 0; i < array->arr_size; i++ ) {
|
||||||
if( array->bml_btls[i].btl == btl ) {
|
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
|
/* move all btl's back by 1, so the found
|
||||||
btl is "removed" */
|
btl is "removed" */
|
||||||
array->bml_btls[i] = array->bml_btls[(i+1)];
|
array->bml_btls[i] = array->bml_btls[(i+1)];
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user