summaryrefslogtreecommitdiffstats
path: root/src/getchar.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-11-15 20:49:41 +0100
committerBram Moolenaar <Bram@vim.org>2020-11-15 20:49:41 +0100
commitca359cbedd0d603124776e7a6ca0ae79ffc34cdc (patch)
tree0af5edfdebeb456661c37910540212d28b95a74c /src/getchar.c
parent6a07644db30cb5f3d0c6dc5eb2c348b6289da553 (diff)
patch 8.2.1991: Coverity warns for not using the ga_grow() return valuev8.2.1991
Problem: Coverity warns for not using the ga_grow() return value. Solution: Bail out if ga_grow() fails. (Yegappan Lakshmanan, closes #7303)
Diffstat (limited to 'src/getchar.c')
-rw-r--r--src/getchar.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/getchar.c b/src/getchar.c
index 3d73a6c7b6..165a6a3ad7 100644
--- 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)
{