From 2f707a4e158c94ae4d2055dc5fbc30fe3fb13a96 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Thu, 15 May 2008 15:58:46 +0000 Subject: [PATCH] 2008-05-15 17:58 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/gtwvg/gtwvg.c * harbour/source/rtl/gtwvt/gtwvt.c ! fixed memory corruption caused by missing ASCII-0 terminator when window title is retrieve --- harbour/ChangeLog | 6 ++++++ harbour/contrib/gtwvg/gtwvg.c | 3 ++- harbour/source/rtl/gtwvt/gtwvt.c | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d306e7c1e9..eec84f84c3 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,12 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-05-15 17:58 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/contrib/gtwvg/gtwvg.c + * harbour/source/rtl/gtwvt/gtwvt.c + ! fixed memory corruption caused by missing ASCII-0 terminator + when window title is retrieve + 2008-05-15 12:37 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * contrib/rddads/rddads.h ! Fix to previous commit to avoid warning. (and again) diff --git a/harbour/contrib/gtwvg/gtwvg.c b/harbour/contrib/gtwvg/gtwvg.c index 5a852f7119..01f3a2c07d 100644 --- a/harbour/contrib/gtwvg/gtwvg.c +++ b/harbour/contrib/gtwvg/gtwvg.c @@ -428,7 +428,8 @@ static BOOL hb_gt_wvt_GetWindowTitle( char ** title ) if( iResult > 0 ) { *title = ( char * ) hb_xgrab( iResult + 1 ); - HB_TCHAR_CONVNREV( *title, buffer, iResult ); + HB_TCHAR_GETFROM( *title, buffer, iResult ); + ( *title )[ iResult ] = '\0'; return TRUE; } diff --git a/harbour/source/rtl/gtwvt/gtwvt.c b/harbour/source/rtl/gtwvt/gtwvt.c index 2f6f7498d5..90ed4a9a22 100644 --- a/harbour/source/rtl/gtwvt/gtwvt.c +++ b/harbour/source/rtl/gtwvt/gtwvt.c @@ -362,7 +362,8 @@ static BOOL hb_gt_wvt_GetWindowTitle( HWND hWnd, char ** title ) if( iResult > 0 ) { *title = ( char * ) hb_xgrab( iResult + 1 ); - HB_TCHAR_CONVNREV( *title, buffer, iResult ); + HB_TCHAR_GETFROM( *title, buffer, iResult ); + ( *title )[ iResult ] = '\0'; return TRUE; }