[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lyx-cvs
Subject:    [LyX/master] Findadv: Do not use out of range index into a string
From:       Kornel Benko <kornel () lyx ! org>
Date:       2020-05-26 13:41:53
Message-ID: 20200526134153.69A992801F5 () lyx ! lyx ! org
[Download RAW message or body]

commit 8dd2ac717148786acaafc5a2db75552b53083f01
Author: Kornel Benko <kornel@lyx.org>
Date:   Tue May 26 15:58:23 2020 +0200

    Findadv: Do not use out of range index into a string
    
    Thanks Scott. Crashing if using _GLIBCXX_DEBUG preprocessor setting
---
 src/lyxfind.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index f98f525..ab5d985 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;
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic