mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
fix: a DICT crash caused by string out of bound access
This commit is contained in:
parent
8fc71c9586
commit
0a4a0958b7
|
@ -538,11 +538,13 @@ void DictServerWordSearchRequest::readMatchData( QByteArray & reply )
|
||||||
if ( word.endsWith( '\"' ) ) {
|
if ( word.endsWith( '\"' ) ) {
|
||||||
word.chop( 1 );
|
word.chop( 1 );
|
||||||
}
|
}
|
||||||
if ( word[ 0 ] == '\"' ) {
|
if ( word.startsWith( '\"' ) ) {
|
||||||
word = word.mid( 1 );
|
word = word.remove( 0, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
this->addMatchedWord( word );
|
if ( !word.isEmpty() ) {
|
||||||
|
this->addMatchedWord( word );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reply = this->dictImpl->socket.readLine();
|
reply = this->dictImpl->socket.readLine();
|
||||||
|
|
Loading…
Reference in a new issue