From bafe7aa49538e4b40d688429f00b2cb01e84c6b9 Mon Sep 17 00:00:00 2001 From: Ron Pinkas Date: Sun, 24 Jun 2001 18:12:34 +0000 Subject: [PATCH] 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. --- harbour/ChangeLog | 4 ++++ harbour/source/vm/arrays.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) 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 ) ); }