AARD: Don't try to read and decode too big articles, it is most likely error in dictionary

This commit is contained in:
Abs62 2013-04-23 20:40:35 +04:00
parent d8ed5046bd
commit 0c2d529d55

View file

@ -461,6 +461,12 @@ void AardDictionary::loadArticle( uint32_t address,
df.seek( articleOffset );
df.read( &size, sizeof(size) );
articleSize = size;
// Don't try to read and decode too big articles,
// it is most likely error in dictionary
if( articleSize > 1048576 )
break;
articleBody.resize( articleSize );
df.read( &articleBody.front(), articleSize );
}