patch 7.4.714
Problem:    Illegal memory access when there are illegal bytes.
Solution:   Check the byte length of the character. (Dominique Pelle)
diff --git a/src/regexp.c b/src/regexp.c
index 6ae05f8..85e0458 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -6113,7 +6113,7 @@
 	    {
 		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])