From 141a288ab7ece839bda123b7008dcc60140ef9e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Thu, 7 May 2015 13:27:18 +0200 Subject: [PATCH] 2015-05-07 13:27 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/rtl/itemseri.c ! fixed stupid typo which could cause buffer overrun during serialization of hash items with default value. Tanks to Abe for reporting the problem. --- ChangeLog.txt | 6 ++++++ src/rtl/itemseri.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index feaa61477c..d82578118a 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,12 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2015-05-07 13:27 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * src/rtl/itemseri.c + ! fixed stupid typo which could cause buffer overrun during + serialization of hash items with default value. + Tanks to Abe for reporting the problem. + 2015-05-05 20:06 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/rtl/disksphb.c * added default path setting in hb_fsDiskSpace() diff --git a/src/rtl/itemseri.c b/src/rtl/itemseri.c index 158192e4b3..fb428a98fe 100644 --- a/src/rtl/itemseri.c +++ b/src/rtl/itemseri.c @@ -625,7 +625,7 @@ static HB_SIZE hb_itemSerialSize( PHB_ITEM pItem, int iFlags, { nSize++; nSize += hb_itemSerialSize( pDefVal, iFlags, - cdpIn, cdpOut, pRefList, nOffset + nSize ); + cdpIn, cdpOut, pRefList, nOffset + nSize ); } nLen = hb_hashLen( pItem ); if( nLen <= 255 ) @@ -948,7 +948,7 @@ static HB_SIZE hb_serializeItem( PHB_ITEM pItem, HB_BOOL iFlags, if( pDefVal ) { pBuffer[ nOffset++ ] = HB_SERIAL_HASHDEFVAL; - nOffset = hb_serializeItem( pDefVal, iHashFlags, + nOffset = hb_serializeItem( pDefVal, iFlags, cdpIn, cdpOut, pBuffer, nOffset, pRefList ); } nLen = hb_hashLen( pItem );