From d09ba62c09742c523bdc6f29125efd7bffe95ba2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 10 Feb 2011 23:11:16 +0000 Subject: [PATCH] 2011-02-11 00:10 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/base64d.c ! HB_BASE64DECODE(): Forgot to return sized buffer in recently added C version of this function. ; Please review and/or stree-test this function. --- harbour/ChangeLog | 6 ++++++ harbour/src/rtl/base64d.c | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ae5223b680..93f23d6d56 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,12 @@ The license applies to all entries newer than 2009-04-28. */ +2011-02-11 00:10 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/base64d.c + ! HB_BASE64DECODE(): Forgot to return sized buffer in recently + added C version of this function. + ; Please review and/or stree-test this function. + 2011-02-10 23:55 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg % PathMakeAbsolute() converted to macro. diff --git a/harbour/src/rtl/base64d.c b/harbour/src/rtl/base64d.c index 933db9c87a..fd2442da9d 100644 --- a/harbour/src/rtl/base64d.c +++ b/harbour/src/rtl/base64d.c @@ -168,10 +168,9 @@ HB_FUNC( HB_BASE64DECODE ) if( len <= INT_MAX ) /* TOFIX */ { char * code = ( char * ) hb_xgrab( ( ( ( ( len - 1 ) * 3 ) / 4 ) + 1 ) * sizeof( char ) ); + HB_SIZE nSize = base64_decode_block( hb_parcx( 1 ), len, code ); - base64_decode_block( hb_parcx( 1 ), len, code ); - - hb_retc_buffer( code ); + hb_retclen_buffer( code, nSize ); } else hb_retc_null();