From 7aa78d726a54fa57a8dc5ed973ab0b30eeba6bf3 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 27 Jun 2014 21:09:44 +0100 Subject: [PATCH] fix potential infinite loop in show_matching highlighter --- src/highlighters.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/highlighters.cc b/src/highlighters.cc index 65b00e3e..51b8111f 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -543,7 +543,7 @@ void show_matching_char(const Context& context, HighlightFlags flags, DisplayBuf apply_colors(colors)); break; } - else if (c == pair.second) + else if (c == pair.second and pos > range.first) { auto it = buffer.iterator_at(pos)-1; auto end = buffer.iterator_at(range.first);