[LyX/master] Fix buffer over-read on last Unicode code points

Yuriy Skalko yuriy.skalko at gmail.com
Sat Nov 28 21:55:42 UTC 2020


commit 9b0cd3c97049c45427103d9352a9d22a6710f181
Author: Yuriy Skalko <yuriy.skalko at gmail.com>
Date:   Fri Nov 27 23:22:35 2020 +0200

    Fix buffer over-read on last Unicode code points
---
 src/frontends/qt/GuiSymbols.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/frontends/qt/GuiSymbols.cpp b/src/frontends/qt/GuiSymbols.cpp
index 050584a..99d1fc0 100644
--- a/src/frontends/qt/GuiSymbols.cpp
+++ b/src/frontends/qt/GuiSymbols.cpp
@@ -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.


More information about the lyx-cvs mailing list