From 143c136a7fb3641f15ba2f152c98558db6b5e989 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 20 Feb 2015 16:51:20 +0100 Subject: [PATCH] Do not read array before checking the bounds Fixes coverity issue 23377 --- src/frontends/qt4/GuiSymbols.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontends/qt4/GuiSymbols.cpp b/src/frontends/qt4/GuiSymbols.cpp index 1e7e7891bf..6ccecf5241 100644 --- a/src/frontends/qt4/GuiSymbols.cpp +++ b/src/frontends/qt4/GuiSymbols.cpp @@ -176,7 +176,7 @@ QString getBlock(char_type c) // guessing was wrong so far. do a real search. int i = 0; - while (c > unicode_blocks[i].end && i < no_blocks) + while (i < no_blocks && c > unicode_blocks[i].end) ++i; if (i == no_blocks) return QString();