From 7dacab9afd21485dff1a578a58840b71f3455bca Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 24 Dec 2019 00:40:39 -0500 Subject: [PATCH] vim-patch:8.2.0033: make_extmatch() OOM #11602 Problem: Crash when make_extmatch() runs out of memory. Solution: Check for NULL. (Dominique Pelle, closs vim/vim#5392) https://github.com/vim/vim/commit/7c77b3496710f1be3232cfdc7f6812347fbd914a --- src/nvim/regexp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 9bc7ef07eb..90dc8ab90f 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -3575,6 +3575,7 @@ theend: * Create a new extmatch and mark it as referenced once. */ static reg_extmatch_T *make_extmatch(void) + FUNC_ATTR_NONNULL_RET { reg_extmatch_T *em = xcalloc(1, sizeof(reg_extmatch_T)); em->refcnt = 1;