aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/regexp_nfa.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/regexp_nfa.c')
-rw-r--r--src/nvim/regexp_nfa.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c
index ab189c0c03..abbb5a3867 100644
--- a/src/nvim/regexp_nfa.c
+++ b/src/nvim/regexp_nfa.c
@@ -1499,6 +1499,10 @@ static int nfa_regatom(void)
if (c == '<' || c == '>')
c = getchr();
while (ascii_isdigit(c)) {
+ if (n > (INT_MAX - (c - '0')) / 10) {
+ EMSG(_("E951: \\% value too large"));
+ return FAIL;
+ }
n = n * 10 + (c - '0');
c = getchr();
}