]> granicus.if.org Git - vim/commitdiff
patch 8.1.1022: may use NULL pointer when out of memory v8.1.1022
authorBram Moolenaar <Bram@vim.org>
Tue, 19 Mar 2019 22:03:27 +0000 (23:03 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 19 Mar 2019 22:03:27 +0000 (23:03 +0100)
Problem:    May use NULL pointer when out of memory. (Coverity)
Solution:   Check for blob_alloc() returning NULL.

src/blob.c
src/version.c

index 9dc7926f4426cac7861373cb4796cc7200975792..ec305d666026d61555f440e61c3a0de96e9a8c2a 100644 (file)
@@ -232,6 +232,8 @@ string2blob(char_u *str)
     blob_T  *blob = blob_alloc();
     char_u  *s = str;
 
+    if (blob == NULL)
+       return NULL;
     if (s[0] != '0' || (s[1] != 'z' && s[1] != 'Z'))
        goto failed;
     s += 2;
index bd02fa5bd9c870c2f16933e36969a5b9130366d6..969b874b7670f79731723589a85642b942e935c4 100644 (file)
@@ -779,6 +779,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1022,
 /**/
     1021,
 /**/