mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 16:08:36 +00: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:
@@ -1420,12 +1420,12 @@ static int nfa_regatom(void)
|
|||||||
default: nr = -1; break;
|
default: nr = -1; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nr < 0)
|
if (nr < 0 || nr > INT_MAX) {
|
||||||
EMSG2_RET_FAIL(
|
EMSG2_RET_FAIL(_("E678: Invalid character after %s%%[dxouU]"),
|
||||||
_("E678: Invalid character after %s%%[dxouU]"),
|
reg_magic == MAGIC_ALL);
|
||||||
reg_magic == MAGIC_ALL);
|
}
|
||||||
/* A NUL is stored in the text as NL */
|
// A NUL is stored in the text as NL
|
||||||
/* TODO: what if a composing character follows? */
|
// TODO(vim): what if a composing character follows?
|
||||||
EMIT(nr == 0 ? 0x0a : nr);
|
EMIT(nr == 0 ? 0x0a : nr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user