mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
AARD: Don't try to read and decode too big articles, it is most likely error in dictionary
This commit is contained in:
parent
d8ed5046bd
commit
0c2d529d55
6
aard.cc
6
aard.cc
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue