# HG changeset patch # User Bram Moolenaar # Date 1558980905 -7200 # Node ID 6fdb0ae0cac3bd6e008011e696db93daaa8bba87 # Parent 575d1863656c1fab6197ee72fdc30fce84ec06ab patch 8.1.1409: Coverity warns for using uninitialized memory commit https://github.com/vim/vim/commit/b43683729b64f83c39840524be232388314bd71f Author: Bram Moolenaar Date: Mon May 27 20:01:41 2019 +0200 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. diff --git a/src/json.c b/src/json.c --- a/src/json.c +++ b/src/json.c @@ -455,7 +455,8 @@ json_decode_string(js_read_T *reader, ty STR2NR_HEX + STR2NR_FORCE, &nr, NULL, 4, TRUE); if (len == 0) { - ga_clear(&ga); + if (res != NULL) + ga_clear(&ga); return FAIL; } p += len + 2; @@ -471,7 +472,8 @@ json_decode_string(js_read_T *reader, ty STR2NR_HEX + STR2NR_FORCE, &nr2, NULL, 4, TRUE); if (len == 0) { - ga_clear(&ga); + if (res != NULL) + ga_clear(&ga); return FAIL; } if (0xdc00 <= nr2 && nr2 <= 0xdfff) @@ -484,6 +486,7 @@ json_decode_string(js_read_T *reader, ty if (res != NULL) { char_u buf[NUMBUFLEN]; + buf[utf_char2bytes((int)nr, buf)] = NUL; ga_concat(&ga, buf); } diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -768,6 +768,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1409, +/**/ 1408, /**/ 1407,