From 9737bbea648ca487574b758aca5cca758d321df8 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Mon, 22 Mar 2010 13:23:18 +0000 Subject: [PATCH] 2010-03-22 14:23 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/rdd/wafunc.c ! added protection against possible GPF when wrong array with field names is passed to __dbTrans() or relative functions --- harbour/ChangeLog | 5 +++++ harbour/src/rdd/wafunc.c | 10 ++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 73856b82ae..736c2d49fb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,11 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-03-22 14:23 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/src/rdd/wafunc.c + ! added protection against possible GPF when wrong array with field + names is passed to __dbTrans() or relative functions + 2010-03-22 12:54 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbdefs.h + added HB_SIZE_MAX macro diff --git a/harbour/src/rdd/wafunc.c b/harbour/src/rdd/wafunc.c index e95da8e443..4868b89d69 100644 --- a/harbour/src/rdd/wafunc.c +++ b/harbour/src/rdd/wafunc.c @@ -855,11 +855,9 @@ static const char * hb_dbTransFieldPos( PHB_ITEM pFields, HB_USHORT uiField ) pItem = hb_arrayGetItemPtr( pFields, uiField ); if( pItem ) { - HB_TYPE type = hb_itemType( pItem ); - - if( type & HB_IT_ARRAY ) + if( HB_IS_ARRAY( pItem ) ) szField = hb_arrayGetCPtr( pItem, DBS_NAME ); - else if( type & HB_IT_STRING ) + else szField = hb_itemGetCPtr( pItem ); if( * szField == '\0' ) @@ -870,8 +868,8 @@ static const char * hb_dbTransFieldPos( PHB_ITEM pFields, HB_USHORT uiField ) } HB_ERRCODE hb_dbTransStruct( AREAP lpaSource, AREAP lpaDest, - LPDBTRANSINFO lpdbTransInfo, - PHB_ITEM *pStruct, PHB_ITEM pFields ) + LPDBTRANSINFO lpdbTransInfo, + PHB_ITEM *pStruct, PHB_ITEM pFields ) { HB_USHORT uiFields, uiSize, uiCount, uiPosSrc, uiPosDst, uiSizeSrc, uiSizeDst; HB_ERRCODE errCode;