]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.166 v7.3.166
authorBram Moolenaar <Bram@vim.org>
Thu, 28 Apr 2011 15:24:58 +0000 (17:24 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 28 Apr 2011 15:24:58 +0000 (17:24 +0200)
Problem:    Buffer on the stack may be too big
Solution:   Allocate the space.

src/option.c
src/version.c

index 6e9b3db1a4f848d4cd728dd9c57510747461a7a1..a545588f41938f564807bf5833f48b850ec9b12b 100644 (file)
@@ -9185,7 +9185,7 @@ put_setstring(fd, cmd, name, valuep, expand)
     int                expand;
 {
     char_u     *s;
-    char_u     buf[MAXPATHL];
+    char_u     *buf;
 
     if (fprintf(fd, "%s %s=", cmd, name) < 0)
        return FAIL;
@@ -9203,9 +9203,16 @@ put_setstring(fd, cmd, name, valuep, expand)
        }
        else if (expand)
        {
+           buf = alloc(MAXPATHL);
+           if (buf == NULL)
+               return FAIL;
            home_replace(NULL, *valuep, buf, MAXPATHL, FALSE);
            if (put_escstr(fd, buf, 2) == FAIL)
+           {
+               vim_free(buf);
                return FAIL;
+           }
+           vim_free(buf);
        }
        else if (put_escstr(fd, *valuep, 2) == FAIL)
            return FAIL;
index 0bc4b7f736fa7032d0ba2379a0263a2414feb1c8..031a0715ccff52bed4edb04aeecadbc4ed2c38fb 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    166,
 /**/
     165,
 /**/