-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opt: headword parse modification #1704
Conversation
@@ -1733,27 +1739,27 @@ static void handleIdxSynFile( string const & fileName, | |||
// punctuation folding. Hopefully there are not a whole lot of valid | |||
// synonyms which really start from slash and contain dollar signs, or | |||
// end with dollar and contain slashes. | |||
if ( *word == '/' ) { | |||
if ( strchr( word, '$' ) ) | |||
if ( headword.front() == '/' ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and probably other lines may crash if wordLen = 0
.
The wordLen
comes from strlen(ptr)
many lines before.
Maybe there should be an early break
of this big for loop if wordLen = 0
.
The next ptr
of this big for loop is just ptr += wordLen + 1;
.
For example, if the data file has two adjacent \0
, what might happen in this region of code is questionable.
(I only skimmed this function briefly, so I don't know if this is really a case 😅)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for loop if
wordLen = 0
.
should be ok. this line used in parse the stardict dictionary.(Can not be sure)
Crash happens when doing the full-text indexing.
I happened to notice that crash has more great probability to occur when multiple stardict dictionaries in the full-text indexing process at the same time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, if the data file has two adjacent
\0
, what might happen in this region of code is questionable.
If this happens ,it is really problemic.
Though We have to rely on the stardict format
476c71d
to
1ff838c
Compare
|
replaced by #1708 |
No description provided.