]> granicus.if.org Git - vim/commitdiff
patch 8.1.2061: MS-Windows GUI: ":sh" crashes when trying to use a terminal v8.1.2061
authorBram Moolenaar <Bram@vim.org>
Fri, 20 Sep 2019 15:20:02 +0000 (17:20 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 20 Sep 2019 15:20:02 +0000 (17:20 +0200)
Problem:    MS-Windows GUI: ":sh" crashes when trying to use a terminal.
Solution:   Check for a NULL command. (Yasuhiro Matsumoto, closes #4958)

src/os_win32.c
src/version.c

index ae77e40ebcdac9e0deb26515ab9d43f8c8443e2a..39b86d6ab6e2e704b6057766b476960b9ea0f7b8 100644 (file)
@@ -4657,12 +4657,14 @@ mch_call_shell(
     {
        char_u  *cmdbase = cmd;
 
-       // Skip a leading quote and (.
-       while (*cmdbase == '"' || *cmdbase == '(')
-           ++cmdbase;
+       if (cmdbase != NULL)
+           // Skip a leading quote and (.
+           while (*cmdbase == '"' || *cmdbase == '(')
+               ++cmdbase;
 
        // Check the command does not begin with "start "
-       if (STRNICMP(cmdbase, "start", 5) != 0 || !VIM_ISWHITE(cmdbase[5]))
+       if (cmdbase == NULL
+               || STRNICMP(cmdbase, "start", 5) != 0 || !VIM_ISWHITE(cmdbase[5]))
        {
            // Use a terminal window to run the command in.
            x = mch_call_shell_terminal(cmd, options);
index 76873d76234cf2006b23085ea58d30e0881f5f19..59a2bb469237c59c13fd42cbf40e632e3ec1291e 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2061,
 /**/
     2060,
 /**/