]> granicus.if.org Git - vim/commitdiff
patch 7.4.903 v7.4.903
authorBram Moolenaar <Bram@vim.org>
Sat, 31 Oct 2015 14:32:52 +0000 (15:32 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 31 Oct 2015 14:32:52 +0000 (15:32 +0100)
Problem:    MS-Windows: When 'encoding' differs from the current code page,
            expandinig wildcards may cause illegal memory access.
Solution:   Allocate a longer buffer. (Ken Takata)

src/misc1.c
src/version.c

index aacf610ad8ef887bfddaec42d4731d540853e104..fa1e049d31069745cb28d6e90f64c02bcb9c5aaa 100644 (file)
@@ -9940,8 +9940,9 @@ dos_expandpath(
            return 0;
     }
 
-    /* make room for file name */
-    buf = alloc((int)STRLEN(path) + BASENAMELEN + 5);
+    /* Make room for file name.  When doing encoding conversion the actual
+     * length may be quite a bit longer, thus use the maximum possible length. */
+    buf = alloc((int)MAXPATHL);
     if (buf == NULL)
        return 0;
 
index 410ce8f3745df60b53a212c5aebef60126cc7500..d6fc7d45e7b174ffbe6663ac56fffd7ea0dfc86c 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    903,
 /**/
     902,
 /**/