From 526b318d134f6ad75cce047a2fbdad256cb9cee2 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 4 May 2015 09:56:57 +0200 Subject: [PATCH] patch 7.4.714 Problem: Illegal memory access when there are illegal bytes. Solution: Check the byte length of the character. (Dominique Pelle) --- src/regexp.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/regexp.c b/src/regexp.c index 6ae05f8f9e..85e0458de0 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]) diff --git a/src/version.c b/src/version.c index 7fff84ffed..6b6d4d5848 100644 --- a/src/version.c +++ b/src/version.c @@ -756,6 +756,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 714, /**/ 713, /**/