]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.685 v7.4.685
authorBram Moolenaar <Bram@vim.org>
Tue, 31 Mar 2015 12:17:31 +0000 (14:17 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 31 Mar 2015 12:17:31 +0000 (14:17 +0200)
Problem:    When there are illegal utf-8 characters the old regexp engine may
            go past the end of a string.
Solution:   Only advance to the end of the string. (Dominique Pelle)

src/regexp.c
src/version.c

index bae547cd6a2af2b9438e41b710d8465fea13874e..961796be511bf23e63d965339c837c5d80ac7a86 100644 (file)
@@ -4782,7 +4782,8 @@ regmatch(scan)
                    /* When only a composing char is given match at any
                     * position where that composing char appears. */
                    status = RA_NOMATCH;
-                   for (i = 0; reginput[i] != NUL; i += utf_char2len(inpc))
+                   for (i = 0; reginput[i] != NUL;
+                                               i += utf_ptr2len(reginput + i))
                    {
                        inpc = mb_ptr2char(reginput + i);
                        if (!utf_iscomposing(inpc))
index f4ed01a647d6ee66e7996660eaa974d53fc70f37..6156c3731913883649146d16cf8b2655aef65f96 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    685,
 /**/
     684,
 /**/