]> granicus.if.org Git - vim/commitdiff
patch 8.2.4430: GTK: crash when using 'guiligatures' and reading from stdin v8.2.4430
authorAmon Sha <amon.sha@gmail.com>
Mon, 21 Feb 2022 15:07:12 +0000 (15:07 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 21 Feb 2022 15:07:12 +0000 (15:07 +0000)
Problem:    GTK: crash when using 'guiligatures' and reading from stdin.
Solution:   Make a copy of the message. (Amon Sha, closes #9719, closes #9814)

src/fileio.c
src/version.c

index 73fa11b3127fb99150a6e5c384c534f325b2c704..21417c27feecba4c9518a8585f064504afac5298 100644 (file)
@@ -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
            }
index 2a8afcec9d2d23021bca83be7e72cbd9aa7f169e..f3b54f0f5dc55ab5c49264263b14db99bd05ecb5 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4430,
 /**/
     4429,
 /**/