]> granicus.if.org Git - vim/commitdiff
patch 8.2.0034: missing check for out of memory v8.2.0034
authorBram Moolenaar <Bram@vim.org>
Mon, 23 Dec 2019 17:18:52 +0000 (18:18 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 23 Dec 2019 17:18:52 +0000 (18:18 +0100)
Problem:    Missing check for out of memory.
Solution:   Check for NULL after vim_strsave(). (Dominique Pelle,
            closes #5393)

src/filepath.c
src/version.c

index 01d2dcb97babcf5f2d252d5cb1b69097c4fa9b4a..ef5edae2349f338e7d8375e6a37e8ac5ccf38c79 100644 (file)
@@ -1658,7 +1658,8 @@ f_resolve(typval_T *argvars, typval_T *rettv)
        int     limit = 100;
 
        p = vim_strsave(p);
-
+       if (p == NULL)
+           goto fail;
        if (p[0] == '.' && (vim_ispathsep(p[1])
                                   || (p[1] == '.' && (vim_ispathsep(p[2])))))
            is_relative_to_current = TRUE;
@@ -1681,7 +1682,10 @@ f_resolve(typval_T *argvars, typval_T *rettv)
 
        buf = alloc(MAXPATHL + 1);
        if (buf == NULL)
+       {
+           vim_free(p);
            goto fail;
+       }
 
        for (;;)
        {
index 3c2c49bd6d84de31697fe9d673350f3e0cc1d187..9f369a95d80666b3f22deda083ce619ca9c0d92a 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    34,
 /**/
     33,
 /**/