changeset 22888:7ac9dea21baa v8.2.1991

patch 8.2.1991: Coverity warns for not using the ga_grow() return value Commit: https://github.com/vim/vim/commit/ca359cbedd0d603124776e7a6ca0ae79ffc34cdc Author: Bram Moolenaar <Bram@vim.org> Date: Sun Nov 15 20:49:41 2020 +0100 patch 8.2.1991: Coverity warns for not using the ga_grow() return value Problem: Coverity warns for not using the ga_grow() return value. Solution: Bail out if ga_grow() fails. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/7303)
author Bram Moolenaar <Bram@vim.org>
date Sun, 15 Nov 2020 21:00:03 +0100
parents d2fdcc5ed237
children eaeeb50221fb
files src/getchar.c src/version.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -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)
 	{
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1991,
+/**/
     1990,
 /**/
     1989,