Mercurial > vim
changeset 27809:b10e94f21344 v8.2.4430
patch 8.2.4430: GTK: crash when using 'guiligatures' and reading from stdin
Commit: https://github.com/vim/vim/commit/101979358f9addfac1414579c4191682e9e42468
Author: Amon Sha <amon.sha@gmail.com>
Date: Mon Feb 21 15:07:12 2022 +0000
patch 8.2.4430: GTK: crash when using 'guiligatures' and reading from stdin
Problem: GTK: crash when using 'guiligatures' and reading from stdin.
Solution: Make a copy of the message. (Amon Sha, closes https://github.com/vim/vim/issues/9719, closes https://github.com/vim/vim/issues/9814)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 21 Feb 2022 16:15:03 +0100 |
parents | ec3ca4ad4694 |
children | 63ed984973c5 |
files | src/fileio.c src/version.c |
diffstat | 2 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/fileio.c +++ b/src/fileio.c @@ -759,8 +759,13 @@ readfile( // Also write a message in the GUI window, if there is one. if (gui.in_use && !gui.dying && !gui.starting) { - p = (char_u *)_("Reading from stdin..."); - gui_write(p, (int)STRLEN(p)); + // make a copy, gui_write() may try to change it + p = vim_strsave((char_u *)_("Reading from stdin...")); + if (p != NULL) + { + gui_write(p, (int)STRLEN(p)); + vim_free(p); + } } #endif }