From 0a95b29d0fff86a3afd4be5d921d1a2c545a71c6 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 23 Jul 2009 18:19:36 +0000 Subject: [PATCH] 2009-07-23 20:18 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/rddads/ads1.c ! Fixed buffer size in one place related to MEMO field handling. Caused memory corruption. --- harbour/ChangeLog | 5 +++++ harbour/contrib/rddads/ads1.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index fb3c7435dc..917e5be217 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,11 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-23 20:18 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/rddads/ads1.c + ! Fixed buffer size in one place related to MEMO field handling. + Caused memory corruption. + 2009-07-23 18:19 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + source/rtl/hbfeof.c * source/rtl/Makefile diff --git a/harbour/contrib/rddads/ads1.c b/harbour/contrib/rddads/ads1.c index 73a2ec2c45..02541f331c 100644 --- a/harbour/contrib/rddads/ads1.c +++ b/harbour/contrib/rddads/ads1.c @@ -2244,7 +2244,7 @@ static HB_ERRCODE adsGetValue( ADSAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) else { u32Len++; /* make room for NULL */ - pucBuf = ( UNSIGNED8 * ) hb_xgrab( u32Len ); + pucBuf = ( UNSIGNED8 * ) hb_xgrab( u32Len + 1 ); AdsGetBinary( pArea->hTable, ADSFIELD( uiIndex ), 0, pucBuf, &u32Len ); hb_itemPutCLPtr( pItem, ( char * ) pucBuf, u32Len ); }