1
0
forked from aniani/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.
This commit is contained in:
Bram Moolenaar
2019-09-09 20:04:13 +02:00
parent 96e38a86a7
commit e5fbd73930
4 changed files with 23 additions and 18 deletions

View File

@@ -168,11 +168,6 @@ msg_attr_keep(
ch_log(NULL, "ERROR: %s", (char *)s);
#endif
/* When displaying keep_msg, don't let msg_start() free it, caller must do
* that. */
if ((char_u *)s == keep_msg)
keep_msg = NULL;
/* Truncate the message if needed. */
msg_start();
buf = msg_strtrunc((char_u *)s, FALSE);