Fix buffer over-read on last Unicode code points

This commit is contained in:
Yuriy Skalko 2020-11-27 23:22:35 +02:00
parent ad7c5568cd
commit 9b0cd3c970

View File

@ -169,7 +169,7 @@ QString getBlock(char_type c)
// c falls into an uncovered area, but we can guess which
if (c > unicode_blocks[lastBlock].end
&& c < unicode_blocks[lastBlock + 1].start)
&& (lastBlock == no_blocks-1 || c < unicode_blocks[lastBlock + 1].start))
return QString();
// guessing was wrong so far. do a real search.