Skip to content

Commit 7465c63

Browse files
committed
patch 7.4.1180
Problem: Crash with invalid argument to glob2regpat(). Solution: Check for NULL. (Justin M. Keyes, closes #596) Add a test.
1 parent f4f79b8 commit 7465c63

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/eval.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12993,7 +12993,8 @@ f_glob2regpat(argvars, rettv)
1299312993
char_u *pat = get_tv_string_chk(&argvars[0]);
1299412994

1299512995
rettv->v_type = VAR_STRING;
12996-
rettv->vval.v_string = file_pat_to_reg_pat(pat, NULL, NULL, FALSE);
12996+
rettv->vval.v_string = (pat == NULL)
12997+
? NULL : file_pat_to_reg_pat(pat, NULL, NULL, FALSE);
1299712998
}
1299812999

1299913000
/*

src/testdir/test_alot.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ source test_backspace_opt.vim
55
source test_cursor_func.vim
66
source test_delete.vim
77
source test_expand.vim
8+
source test_glob2regpat.vim
89
source test_json.vim
910
source test_lispwords.vim
1011
source test_menu.vim

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,8 @@ static char *(features[]) =
746746

747747
static int included_patches[] =
748748
{ /* Add new patch number below this line */
749+
/**/
750+
1180,
749751
/**/
750752
1179,
751753
/**/

0 commit comments

Comments
 (0)