From ed68d1ff287d43c5293abb4d41e908aa8e50afec Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 2 Jul 2014 21:14:01 +0100 Subject: utf8: use end of sequence iterators for more security --- src/buffer_utils.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/buffer_utils.cc') diff --git a/src/buffer_utils.cc b/src/buffer_utils.cc index c59157a5..5eeb188f 100644 --- a/src/buffer_utils.cc +++ b/src/buffer_utils.cc @@ -14,7 +14,7 @@ CharCount get_column(const Buffer& buffer, auto col = 0_char; for (auto it = line.begin(); it != line.end() and coord.column > (int)(it - line.begin()); - it = utf8::next(it)) + it = utf8::next(it, line.end())) { if (*it == '\t') col = (col / tabstop + 1) * tabstop; -- cgit v1.2.3