2008-06-03 10:12 UTC+0100 Viktor Szakats (harbour.01 syenar hu)

* source/vm/extend.c
     ! Reverted previous change. Caller should check the 
       retval of hb_storclen_buffer() and free the pointer 
       in case it's zero.
       Thanks Przemek.

   * contrib/hbw32/w32_regc.c
   * contrib/hbhpdf/harupdf.c
   * contrib/hbwhat32/_winsys.c
   * utils/hbmake/readline.c
     ! Fixed hb_storclen_buffer() calls.

   * contrib/hbwhat32/_winsys.c
     ! SYSTEMPARAMETERSINFO() fixed retval and leaks.
     ; Please test.

   * source/rtl/tget.prg
     ! Typo.
This commit is contained in:
Viktor Szakats
2008-06-03 08:41:32 +00:00
parent 83b872a811
commit 71eb525cdf
8 changed files with 53 additions and 34 deletions

View File

@@ -8,6 +8,26 @@
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2008-06-03 10:12 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* source/vm/extend.c
! Reverted previous change. Caller should check the
retval of hb_storclen_buffer() and free the pointer
in case it's zero.
Thanks Przemek.
* contrib/hbw32/w32_regc.c
* contrib/hbhpdf/harupdf.c
* contrib/hbwhat32/_winsys.c
* utils/hbmake/readline.c
! Fixed hb_storclen_buffer() calls.
* contrib/hbwhat32/_winsys.c
! SYSTEMPARAMETERSINFO() fixed retval and leaks.
; Please test.
* source/rtl/tget.prg
! Typo.
2008-06-03 09:11 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* include/rdd.api
+ Added necessary conversions.
@@ -22,8 +42,8 @@
! Fixed indentation.
* contrib/hbhpdf/harupdf.c
! Fixed hpdf_ReadFromStream() fixed to not overflow
to buffer in hb_storlen_buffer().
! Fixed hpdf_ReadFromStream() to not overflow
to buffer in hb_storclen_buffer().
2008-06-03 01:31 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* source/vm/extend.c

View File

@@ -489,7 +489,8 @@ HB_FUNC( CURL_EASY_RECV )
hb_retnl( ( long ) curl_easy_recv( hb_curl->curl, buffer, size, &size ) );
hb_storclen_buffer( ( char * ) buffer, size, 2 );
if( ! hb_storclen_buffer( ( char * ) buffer, size, 2 ) )
hb_free( buffer );
}
}

View File

@@ -187,7 +187,8 @@ HB_FUNC( HPDF_READFROMSTREAM )
hb_retnl( (long) HPDF_ReadFromStream( HPDF_Doc_par( 1 ), buffer, &size ) );
hb_storclen_buffer( ( char * ) buffer, size, 2 );
if( ! hb_storclen_buffer( ( char * ) buffer, size, 2 ) )
hb_xfree( buffer );
}
//----------------------------------------------------------------------//
// HPdf_ResetStream( hDoc ) -> hStatus

View File

@@ -152,7 +152,9 @@ HB_FUNC( WIN32_REGQUERYVALUEEX )
&nSize );
hb_stornl( nType, 4 );
hb_storclen_buffer( ( char * ) cValue, nSize, 5 );
if( ! hb_storclen_buffer( ( char * ) cValue, nSize, 5 ) )
hb_free( cValue );
}
}

View File

@@ -184,35 +184,32 @@ HB_FUNC( MULDIV )
//
HB_FUNC( SYSTEMPARAMETERSINFO )
{
char *cText;
PHB_ITEM pBuffer = hb_param( 3, HB_IT_STRING );
if( pBuffer )
{
cText = (char*) hb_xgrab( hb_itemGetCLen( pBuffer )+1 );
char * cText = (char*) hb_xgrab( hb_itemGetCLen( pBuffer )+1 );
hb_xmemcpy( cText, hb_itemGetC( pBuffer ), hb_itemGetCLen( pBuffer )+1 );
}
else
{
hb_retl( FALSE );
return;
if( SystemParametersInfo( (UINT) hb_parni( 1 ),
(UINT) hb_parni( 2 ),
cText,
(UINT) hb_parni( 4 ) ) )
{
if( ISBYREF( 3 ) )
{
if( ! hb_storclen_buffer( cText, hb_itemGetCLen( pBuffer ), 3 ) )
hb_xfree( xText );
hb_retl( TRUE );
return;
}
}
hb_xfree( xText );
}
if( SystemParametersInfo( (UINT) hb_parni( 1 ),
(UINT) hb_parni( 2 ),
cText,
(UINT) hb_parni( 4 ) ) )
{
if( ISBYREF( 3 ) )
{
hb_storclen_buffer( cText, hb_itemGetCLen( pBuffer ), 3 );
hb_retl( TRUE );
}
}
else
{
hb_retl( FALSE );
}
hb_retl( FALSE );
}
//-------------------------------------------------------------------//

View File

@@ -842,8 +842,8 @@ METHOD delRight() CLASS Get
RETURN Self
/* NOTE ::wordLeft()
::delWordRight() */
/* ::wordLeft()
::delWordRight() */
METHOD delWordLeft() CLASS Get

View File

@@ -1007,10 +1007,6 @@ HB_EXPORT int hb_storclen_buffer( char * szText, ULONG ulLen, int iParam, ... )
}
}
/* Make sure to free the pointer in case it couldn't be stored. */
if( szText )
hb_xfree( szText );
return 0;
}

View File

@@ -242,7 +242,9 @@ HB_FUNC( HB_FREADLINE )
pBuffer = hb_fsReadLine( hFileHandle, &lSize, Term, iTermSizes, iTerms, &bFound, &bEOF );
hb_storclen_buffer( (char*) pBuffer, lSize, 2 );
if( ! hb_storclen_buffer( (char*) pBuffer, lSize, 2 ) )
hb_xfree( pBuffer );
hb_retnl( bEOF ? -1 : 0 );
hb_xfree( Term );
hb_xfree( iTermSizes );