correctly detect empty dict and set top ptr to null. Fixes crash

using empty dicts.
This commit is contained in:
Andy2 2010-12-17 18:54:27 -08:00
parent c5e0955460
commit 53de4eab9b

View file

@ -320,7 +320,7 @@ parseDict( AndDictionaryCtxt* ctxt, XP_U8* ptr, XP_U32 dictLength )
andLoadSpecialData( ctxt, &ptr );
dictLength -= ptr - (XP_U8*)mappedBase;
if ( dictLength > sizeof(XP_U32) ) {
if ( dictLength >= sizeof(offset) ) {
offset = n_ptr_tohl( &ptr );
dictLength -= sizeof(offset);
#ifdef NODE_CAN_4