]> granicus.if.org Git - vim/commitdiff
patch 7.4.1180 v7.4.1180
authorBram Moolenaar <Bram@vim.org>
Mon, 25 Jan 2016 21:20:27 +0000 (22:20 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 25 Jan 2016 21:20:27 +0000 (22:20 +0100)
Problem:    Crash with invalid argument to glob2regpat().
Solution:   Check for NULL. (Justin M. Keyes, closes #596)  Add a test.

src/eval.c
src/testdir/test_alot.vim
src/version.c

index 359956be1a0e3f5f51838dfe315eddf5e2e7c040..590834fe4a87684a9d0afccb972c393cd099713b 100644 (file)
@@ -12993,7 +12993,8 @@ f_glob2regpat(argvars, rettv)
     char_u     *pat = get_tv_string_chk(&argvars[0]);
 
     rettv->v_type = VAR_STRING;
-    rettv->vval.v_string = file_pat_to_reg_pat(pat, NULL, NULL, FALSE);
+    rettv->vval.v_string = (pat == NULL)
+                        ? NULL : file_pat_to_reg_pat(pat, NULL, NULL, FALSE);
 }
 
 /*
index aceb073f699578bb252e699cdb5e32ffee4ad467..97454335deb99b4b2126721c9d82ee77d62376d1 100644 (file)
@@ -5,6 +5,7 @@ source test_backspace_opt.vim
 source test_cursor_func.vim
 source test_delete.vim
 source test_expand.vim
+source test_glob2regpat.vim
 source test_json.vim
 source test_lispwords.vim
 source test_menu.vim
index 073f551dd12e0171e8c0cbdec138bfe90566358a..ee6ac48c4b33d38d1c8c223b1e6ff314cb9453bd 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1180,
 /**/
     1179,
 /**/