Compare commits

...

3 commits

Author SHA1 Message Date
shenleban tongying 243ce1c7b7
Merge daf2e81ae3 into 20fcea33e1 2024-11-12 20:01:59 -05:00
shenleban tongying daf2e81ae3
Merge branch 'staged' into fix/dict-fix-for-real 2024-11-12 17:27:31 -05:00
shenleban tongying f59b04565a fix: dict.org crashes by incomplete response and str out of bound access 2024-11-12 16:32:32 -05:00

View file

@ -538,14 +538,22 @@ void DictServerWordSearchRequest::readMatchData( QByteArray & reply )
if ( word.endsWith( '\"' ) ) {
word.chop( 1 );
}
if ( word[ 0 ] == '\"' ) {
if ( word.startsWith( '\"' ) ) {
word = word.mid( 1 );
}
if ( !word.isEmpty() ) {
this->addMatchedWord( word );
}
}
constexpr int halfSecond = 500;
if ( this->dictImpl->socket.waitForReadyRead( halfSecond ) ) {
reply = this->dictImpl->socket.readLine();
}
else {
return;
}
} while ( true );
}