]> granicus.if.org Git - vim/commitdiff
patch 8.2.1991: Coverity warns for not using the ga_grow() return value v8.2.1991
authorBram Moolenaar <Bram@vim.org>
Sun, 15 Nov 2020 19:49:41 +0000 (20:49 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 15 Nov 2020 19:49:41 +0000 (20:49 +0100)
Problem:    Coverity warns for not using the ga_grow() return value.
Solution:   Bail out if ga_grow() fails. (Yegappan Lakshmanan, closes #7303)

src/getchar.c
src/version.c

index 3d73a6c7b63f87be3d2de44927c54a789fe523fe..165a6a3ad7b84256341598bbc4470b757f23ae94 100644 (file)
@@ -3645,7 +3645,11 @@ getcmdkeycmd(
     got_int = FALSE;
     while (c1 != NUL && !aborted)
     {
-       ga_grow(&line_ga, 32);
+       if (ga_grow(&line_ga, 32) != OK)
+       {
+           aborted = TRUE;
+           break;
+       }
 
        if (vgetorpeek(FALSE) == NUL)
        {
index 5978bdce54a6e9b893eeb0dae1f190ddfaf322cd..4f03b2627c1f00c0524c249d171cd995900b3c2b 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1991,
 /**/
     1990,
 /**/