Skip to content

Commit

Permalink
fix: dsl dictionary crash when skip expandOptionalParts as headword i…
Browse files Browse the repository at this point in the history
…s too long
  • Loading branch information
xiaoyifang committed May 21, 2022
1 parent 2b9b278 commit 40f67d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
7 changes: 3 additions & 4 deletions dsl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2153,10 +2153,9 @@ vector< sptr< Dictionary::Class > > makeDictionaries(

hasString = false;

// The line read should either consist of pure whitespace, or be a
// headword

if ( curString.empty() )
// The line read should either consist of pure whitespace, or be a headword
// skip too long headword,it can never be headword.
if( curString.empty() || curString.size() > 100 )
continue;

if ( isDslWs( curString[ 0 ] ) )
Expand Down
6 changes: 0 additions & 6 deletions dsl_details.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1155,12 +1155,6 @@ void expandOptionalParts( wstring & str, list< wstring > * result,
list< wstring > * headwords;
headwords = inside_recurse ? result : &expanded;

//if str is too long ,it can never be headwords.
//todo?
if( str.size() > 100 )
{
return;
}
for( ; x < str.size(); )
{
wchar ch = str[ x ];
Expand Down

0 comments on commit 40f67d7

Please sign in to comment.