diff options
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r-- | src/ex_getln.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c index 9683e2ebd5..8f0be52088 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -4377,6 +4377,10 @@ get_list_range(char_u **str, int *num1, int *num2) { vim_str2nr(*str, NULL, &len, 0, &num, NULL, 0, FALSE, NULL); *str += len; + // overflow + if (num > INT_MAX) + return FAIL; + *num1 = (int)num; first = TRUE; } @@ -4387,8 +4391,12 @@ get_list_range(char_u **str, int *num1, int *num2) vim_str2nr(*str, NULL, &len, 0, &num, NULL, 0, FALSE, NULL); if (len > 0) { - *num2 = (int)num; *str = skipwhite(*str + len); + // overflow + if (num > INT_MAX) + return FAIL; + + *num2 = (int)num; } else if (!first) // no number given at all return FAIL; |