aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Document.cxx2
1 files changed, 1 insertions, 1 deletions
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 &regexp, 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];