From: Bram Moolenaar Date: Tue, 19 Mar 2019 22:03:27 +0000 (+0100) Subject: patch 8.1.1022: may use NULL pointer when out of memory X-Git-Tag: v8.1.1022 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e142a9467a7f6845a426d8db6efedf246d3c13ac;p=vim 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. --- diff --git a/src/blob.c b/src/blob.c index 9dc7926f4..ec305d666 100644 --- 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; diff --git a/src/version.c b/src/version.c index bd02fa5bd..969b874b7 100644 --- a/src/version.c +++ b/src/version.c @@ -779,6 +779,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1022, /**/ 1021, /**/