diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f1b6180c7e..307f1559ae 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +2001-06-24 11:15 UTC-0800 Ron Pinkas + * source/vm/arrays.c + ! Fixed but in hb_arrayDel() which caused a GPF by accessing an item beyond the array end. + 2001-06-23 21:40 UTC-0800 Ron Pinkas * contrib/rdd_ads/ads1.c - Removed 2 sets of parentheses in type casts where it was not needed. diff --git a/harbour/source/vm/arrays.c b/harbour/source/vm/arrays.c index 75a7b4f72b..6f0de213a5 100644 --- a/harbour/source/vm/arrays.c +++ b/harbour/source/vm/arrays.c @@ -209,8 +209,10 @@ BOOL hb_arrayDel( PHB_ITEM pArray, ULONG ulIndex ) hb_itemClear( pBaseArray->pItems + ( ulIndex - 1 ) ); - for( ulIndex--; ulIndex < ulLen; ulIndex++ ) /* move items */ + for( ulIndex--; ulIndex < ulLen - 1; ulIndex++ ) /* move items */ + { hb_itemCopy( pBaseArray->pItems + ulIndex, pBaseArray->pItems + ( ulIndex + 1 ) ); + } hb_itemClear( pBaseArray->pItems + ( ulLen - 1 ) ); }