From c9c7c193586c27faaaf7b33b529a47aa200dfdc8 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 2 Sep 2021 14:25:24 +1000 Subject: Bug [#2281] Fix crash with too many subexpressions in regular expression search with SCFIND_CXX11REGEX. --- src/Document.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Document.cxx b/src/Document.cxx index 657191ee1..8baa84ad8 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -3208,7 +3208,7 @@ bool MatchOnLines(const Document *doc, const Regex ®exp, const RESearchRange } #endif if (matched) { - for (size_t co = 0; co < match.size(); co++) { + for (size_t co = 0; co < match.size() && co < RESearch::MAXTAG; co++) { search.bopat[co] = match[co].first.Pos(); search.eopat[co] = match[co].second.PosRoundUp(); const Sci::Position lenMatch = search.eopat[co] - search.bopat[co]; -- cgit v1.2.3