mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.0968: crash when using search pattern \%Ufffffc23
Problem: Crash when using search pattern \%Ufffffc23.
Solution: Limit character to INT_MAX. (closes vim/vim#4009)
527a2d86fb
This commit is contained in:
parent
a66b1d4615
commit
b183534c81
@ -1420,12 +1420,12 @@ static int nfa_regatom(void)
|
||||
default: nr = -1; break;
|
||||
}
|
||||
|
||||
if (nr < 0)
|
||||
EMSG2_RET_FAIL(
|
||||
_("E678: Invalid character after %s%%[dxouU]"),
|
||||
reg_magic == MAGIC_ALL);
|
||||
/* A NUL is stored in the text as NL */
|
||||
/* TODO: what if a composing character follows? */
|
||||
if (nr < 0 || nr > INT_MAX) {
|
||||
EMSG2_RET_FAIL(_("E678: Invalid character after %s%%[dxouU]"),
|
||||
reg_magic == MAGIC_ALL);
|
||||
}
|
||||
// A NUL is stored in the text as NL
|
||||
// TODO(vim): what if a composing character follows?
|
||||
EMIT(nr == 0 ? 0x0a : nr);
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user