mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
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.
This commit is contained in:
@@ -232,6 +232,8 @@ string2blob(char_u *str)
|
|||||||
blob_T *blob = blob_alloc();
|
blob_T *blob = blob_alloc();
|
||||||
char_u *s = str;
|
char_u *s = str;
|
||||||
|
|
||||||
|
if (blob == NULL)
|
||||||
|
return NULL;
|
||||||
if (s[0] != '0' || (s[1] != 'z' && s[1] != 'Z'))
|
if (s[0] != '0' || (s[1] != 'z' && s[1] != 'Z'))
|
||||||
goto failed;
|
goto failed;
|
||||||
s += 2;
|
s += 2;
|
||||||
|
@@ -779,6 +779,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1022,
|
||||||
/**/
|
/**/
|
||||||
1021,
|
1021,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user