From 44531928b3512b143f6e3c958e49f99e827eb7de Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 31 May 2020 17:01:28 -0400 Subject: vim-patch:8.1.2018: using freed memory when out of memory and displaying message Problem: Using freed memory when out of memory and displaying message. Solution: Make a copy of the message first. https://github.com/vim/vim/commit/e5fbd7393067c279860598ac8359d1617b1082b9 --- src/nvim/message.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/nvim/message.c') diff --git a/src/nvim/message.c b/src/nvim/message.c index 9aa588e035..8999365d32 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -306,11 +306,6 @@ bool msg_attr_keep(char_u *s, int attr, bool keep, bool multiline) add_msg_hist((const char *)s, -1, attr, multiline); } - /* When displaying keep_msg, don't let msg_start() free it, caller must do - * that. */ - if (s == keep_msg) - keep_msg = NULL; - /* Truncate the message if needed. */ msg_start(); buf = msg_strtrunc(s, FALSE); -- cgit