From d45aa55d42211eb2f42e0a04ff77537a5df51c40 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 21 May 2018 22:50:29 +0200 Subject: [PATCH] patch 8.1.0016: possible crash in term_wait() Problem: Possible crash in term_wait(). (Dominique Pelle) Solution: Check for a valid buffer after ui_delay(). (closes #2944) --- src/terminal.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/terminal.c b/src/terminal.c index 817e6b937..6967df73c 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -5264,11 +5264,11 @@ f_term_wait(typval_T *argvars, typval_T *rettv UNUSED) { mch_check_messages(); parse_queued_messages(); + ui_delay(10L, FALSE); if (!buf_valid(buf)) /* If the terminal is closed when the channel is closed the * buffer disappears. */ break; - ui_delay(10L, FALSE); } mch_check_messages(); parse_queued_messages(); diff --git a/src/version.c b/src/version.c index d1a75a114..7d941bbe4 100644 --- a/src/version.c +++ b/src/version.c @@ -761,6 +761,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 16, /**/ 15, /**/ -- 2.40.0