diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-03-19 23:03:27 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-03-19 23:03:27 +0100 |
commit | e142a9467a7f6845a426d8db6efedf246d3c13ac (patch) | |
tree | 003322cbd974d19d3e792d41ddb9ebcbeaaaf2db /src/blob.c | |
parent | 8e9a24a127c4ef8833fdc3986623f96c7d04210f (diff) | |
download | vim-git-e142a9467a7f6845a426d8db6efedf246d3c13ac.tar.gz |
patch 8.1.1022: may use NULL pointer when out of memoryv8.1.1022
Problem: May use NULL pointer when out of memory. (Coverity)
Solution: Check for blob_alloc() returning NULL.
Diffstat (limited to 'src/blob.c')
-rw-r--r-- | src/blob.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |