From: Kornel Benko Date: Tue, 26 May 2020 13:58:23 +0000 (+0200) Subject: Findadv: Do not use out of range index into a string X-Git-Tag: lyx-2.4.0dev-acb2ca7b~823 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8dd2ac717148786acaafc5a2db75552b53083f01;p=features.git Findadv: Do not use out of range index into a string Thanks Scott. Crashing if using _GLIBCXX_DEBUG preprocessor setting --- diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index f98f525cbe..ab5d98580e 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -2432,7 +2432,7 @@ int LatexInfo::dispatch(ostringstream &os, int previousStart, KeyInfo &actual) int val = actual._tokenstart; for (count = 0; count < actual._tokenstart;) { val = interval_.previousNotIgnored(val-1); - if (interval_.par[val] != ' ') + if (val < 0 || interval_.par[val] != ' ') break; else { count = actual._tokenstart - val;