summaryrefslogtreecommitdiff
path: root/src/regexp.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-05-04 09:56:49 +0200
committerBram Moolenaar <Bram@vim.org>2015-05-04 09:56:49 +0200
commit069dd08d8dbbbadc4e6780d5c881a24bce79a4f7 (patch)
tree6306d1906a7c58d4184adefc710f5ce2862ef291 /src/regexp.c
parentea98f8b4d6d2d2843b803f4c105cff1fe6fa0a90 (diff)
downloadvim-git-069dd08d8dbbbadc4e6780d5c881a24bce79a4f7.tar.gz
patch 7.4.714v7.4.714
Problem: Illegal memory access when there are illegal bytes. Solution: Check the byte length of the character. (Dominique Pelle)
Diffstat (limited to 'src/regexp.c')
-rw-r--r--src/regexp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/regexp.c b/src/regexp.c
index 6ae05f8f9..85e0458de 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -6113,7 +6113,7 @@ do_class:
{
if (ireg_ic && enc_utf8)
cf = utf_fold(utf_ptr2char(opnd));
- while (count < maxcount)
+ while (count < maxcount && (*mb_ptr2len)(scan) >= len)
{
for (i = 0; i < len; ++i)
if (opnd[i] != scan[i])