forked from aniani/vim
patch 8.1.1409: Coverity warns for using uninitialized memory
Problem: Coverity warns for using uninitialized memory. Solution: Add a condition to clearing the growarray.
This commit is contained in:
@@ -455,6 +455,7 @@ json_decode_string(js_read_T *reader, typval_T *res, int quote)
|
|||||||
STR2NR_HEX + STR2NR_FORCE, &nr, NULL, 4, TRUE);
|
STR2NR_HEX + STR2NR_FORCE, &nr, NULL, 4, TRUE);
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
{
|
{
|
||||||
|
if (res != NULL)
|
||||||
ga_clear(&ga);
|
ga_clear(&ga);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
@@ -471,6 +472,7 @@ json_decode_string(js_read_T *reader, typval_T *res, int quote)
|
|||||||
STR2NR_HEX + STR2NR_FORCE, &nr2, NULL, 4, TRUE);
|
STR2NR_HEX + STR2NR_FORCE, &nr2, NULL, 4, TRUE);
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
{
|
{
|
||||||
|
if (res != NULL)
|
||||||
ga_clear(&ga);
|
ga_clear(&ga);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
@@ -484,6 +486,7 @@ json_decode_string(js_read_T *reader, typval_T *res, int quote)
|
|||||||
if (res != NULL)
|
if (res != NULL)
|
||||||
{
|
{
|
||||||
char_u buf[NUMBUFLEN];
|
char_u buf[NUMBUFLEN];
|
||||||
|
|
||||||
buf[utf_char2bytes((int)nr, buf)] = NUL;
|
buf[utf_char2bytes((int)nr, buf)] = NUL;
|
||||||
ga_concat(&ga, buf);
|
ga_concat(&ga, buf);
|
||||||
}
|
}
|
||||||
|
@@ -767,6 +767,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 */
|
||||||
|
/**/
|
||||||
|
1409,
|
||||||
/**/
|
/**/
|
||||||
1408,
|
1408,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user