mirror of
https://github.com/neovim/neovim.git
synced 2026-03-31 04:42:03 +00:00
vim-patch:9.1.0700: crash with 2byte encoding and glob2regpat()
Problem: possible crash with 2byte encoding and glob2regpat()
Solution: Skip over character, if it is multi-byte character
1c815b54bb
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -3754,7 +3754,6 @@ char *file_pat_to_reg_pat(const char *pat, const char *pat_end, char *allow_dirs
|
||||
*allow_dirs = true;
|
||||
}
|
||||
reg_pat[i++] = '\\';
|
||||
reg_pat[i++] = *p;
|
||||
}
|
||||
break;
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
|
||||
BIN
test/old/testdir/crash/heap_overflow_glob2regpat
Normal file
BIN
test/old/testdir/crash/heap_overflow_glob2regpat
Normal file
Binary file not shown.
@@ -226,6 +226,12 @@ func Test_crash1_3()
|
||||
call term_sendkeys(buf, args)
|
||||
call TermWait(buf, 150)
|
||||
|
||||
let file = 'crash/heap_overflow_glob2regpat'
|
||||
let cmn_args = "%s -u NONE -i NONE -n -X -m -n -e -s -S %s -c ':qa!'"
|
||||
let args = printf(cmn_args, vim, file)
|
||||
call term_sendkeys(buf, args)
|
||||
call TermWait(buf, 50)
|
||||
|
||||
|
||||
" clean up
|
||||
exe buf .. "bw!"
|
||||
|
||||
Reference in New Issue
Block a user