changeset 16034:27f9f4c1400b v8.1.1022

patch 8.1.1022: may use NULL pointer when out of memory commit https://github.com/vim/vim/commit/e142a9467a7f6845a426d8db6efedf246d3c13ac Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 19 23:03:27 2019 +0100 patch 8.1.1022: may use NULL pointer when out of memory Problem: May use NULL pointer when out of memory. (Coverity) Solution: Check for blob_alloc() returning NULL.
author Bram Moolenaar <Bram@vim.org>
date Tue, 19 Mar 2019 23:15:04 +0100
parents 145ee92315f6
children 3aef7d9ea3f9
files src/blob.c src/version.c
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/blob.c
+++ b/src/blob.c
@@ -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;
--- a/src/version.c
+++ b/src/version.c
@@ -780,6 +780,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1022,
+/**/
     1021,
 /**/
     1020,