0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

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

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt 2024-08-28 22:08:35 +02:00
parent f8702aeb8f
commit 1c815b54bb
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
4 changed files with 10 additions and 1 deletions

View File

@ -5714,7 +5714,8 @@ file_pat_to_reg_pat(
) )
*allow_dirs = TRUE; *allow_dirs = TRUE;
reg_pat[i++] = '\\'; reg_pat[i++] = '\\';
reg_pat[i++] = *p; if (enc_dbcs != 0 && (*mb_ptr2len)(p) > 1)
reg_pat[i++] = *p++;
} }
break; break;
#ifdef BACKSLASH_IN_FILENAME #ifdef BACKSLASH_IN_FILENAME

Binary file not shown.

View File

@ -222,6 +222,12 @@ func Test_crash1_3()
call term_sendkeys(buf, args) call term_sendkeys(buf, args)
call TermWait(buf, 150) 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 " clean up
exe buf .. "bw!" exe buf .. "bw!"

View File

@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
700,
/**/ /**/
699, 699,
/**/ /**/