Findadv: Do not use out of range index into a string

Thanks Scott. Crashing if using _GLIBCXX_DEBUG preprocessor setting
This commit is contained in:
Kornel Benko 2020-05-26 15:58:23 +02:00
parent a7428c0855
commit 8dd2ac7171

View File

@ -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;