mirror of
https://github.com/vim/vim.git
synced 2025-09-02 21:13:50 -04:00
patch 9.1.0701: crash with NFA regex engine when searching for composing chars
Problem: crash with NFA regex engine when searching for composing chars (SuyueGuo) Solution: When there is no composing character, break out of the loop and check that out1 state is not null fixes: #15583 Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
1c815b54bb
commit
c3a02d78bd
@ -6525,7 +6525,8 @@ nfa_regmatch(
|
|||||||
else
|
else
|
||||||
result = FAIL;
|
result = FAIL;
|
||||||
|
|
||||||
if (t->state->out->out1->c == NFA_END_COMPOSING)
|
if (t->state->out->out1 != NULL
|
||||||
|
&& t->state->out->out1->c == NFA_END_COMPOSING)
|
||||||
{
|
{
|
||||||
end = t->state->out->out1;
|
end = t->state->out->out1;
|
||||||
ADD_STATE_IF_MATCH(end);
|
ADD_STATE_IF_MATCH(end);
|
||||||
|
BIN
src/testdir/crash/nullptr_regexp_nfa
Normal file
BIN
src/testdir/crash/nullptr_regexp_nfa
Normal file
Binary file not shown.
@ -228,6 +228,11 @@ func Test_crash1_3()
|
|||||||
call term_sendkeys(buf, args)
|
call term_sendkeys(buf, args)
|
||||||
call TermWait(buf, 50)
|
call TermWait(buf, 50)
|
||||||
|
|
||||||
|
let file = 'crash/nullptr_regexp_nfa'
|
||||||
|
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!"
|
||||||
|
@ -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 */
|
||||||
|
/**/
|
||||||
|
701,
|
||||||
/**/
|
/**/
|
||||||
700,
|
700,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user