2025-12-04 16:39 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* src/rtl/cdpapi.c
    ! fixed hb_cdpUTF8StringPeek() to work with 0 based indexes and
      Unicode characters > 0xFFFF

  * src/rtl/hbmd5.c
    ! removed redundant code (copy and past typo)
This commit is contained in:
Przemysław Czerpak
2025-12-04 16:39:21 +01:00
parent 5573638fcc
commit aa54fe630f
3 changed files with 12 additions and 12 deletions

View File

@@ -7,6 +7,14 @@
Entries may not always be in chronological/commit order.
See license at the end of file. */
2025-12-04 16:39 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/cdpapi.c
! fixed hb_cdpUTF8StringPeek() to work with 0 based indexes and
Unicode characters > 0xFFFF
* src/rtl/hbmd5.c
! removed redundant code (copy and past typo)
2025-11-22 12:40 UTC+0100 Aleksander Czajczynski (hb fki.pl)
* include/hbdefs.h
! fix undefined behaviour on signed int overflow in

View File

@@ -1505,11 +1505,11 @@ HB_WCHAR32 hb_cdpUTF8StringPeek( const char * pSrc, HB_SIZE nLen, HB_SIZE nPos )
{
HB_SIZE nIndex = 0;
while( nPos && nIndex < nLen )
while( nIndex < nLen )
{
HB_WCHAR wc;
hb_cdpUTF8GetU16( pSrc, nLen, &nIndex, &wc );
if( --nPos == 0 )
HB_WCHAR32 wc;
hb_cdpUTF8GetU32( pSrc, nLen, &nIndex, &wc );
if( nPos-- == 0 )
return wc;
}
return 0;

View File

@@ -417,14 +417,6 @@ HB_FUNC( HB_MD5 ) /* Considered insecure. Use SHA256 or higher instead. */
}
else
hb_retclen( dststr, HB_SIZEOFARRAY( dststr ) );
if( ! hb_parl( 2 ) )
{
char digest[ ( sizeof( dststr ) * 2 ) + 1 ];
hb_strtohex( dststr, sizeof( dststr ), digest );
hb_retclen( digest, HB_SIZEOFARRAY( digest ) - 1 );
}
else
hb_retclen( dststr, HB_SIZEOFARRAY( dststr ) );
}
else
hb_retc_null(); /* return empty string on wrong call */