mirror of
https://github.com/neovim/neovim.git
synced 2026-04-02 13:49:27 +00:00
vim-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: vim/vim#15583
c3a02d78bd
Test uses DBCS 'encoding', which is N/A.
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -14799,7 +14799,8 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *subm
|
||||
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;
|
||||
ADD_STATE_IF_MATCH(end);
|
||||
}
|
||||
|
||||
BIN
test/old/testdir/crash/nullptr_regexp_nfa
Normal file
BIN
test/old/testdir/crash/nullptr_regexp_nfa
Normal file
Binary file not shown.
@@ -232,6 +232,11 @@ func Test_crash1_3()
|
||||
call term_sendkeys(buf, args)
|
||||
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
|
||||
exe buf .. "bw!"
|
||||
|
||||
Reference in New Issue
Block a user