diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-10-06 19:16:36 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-10-06 19:18:12 +0200 |
commit | a991ce9c083bb8c02b1b1ec34ed35728197050f3 (patch) | |
tree | 86b81d3c944a52d370959307b44136356cd27976 /src/eval.c | |
parent | ac9c6d5c786a016ca1dce297d167a5a963881f7e (diff) |
patch 9.0.1995: Invalid memory access with empty 'foldexpr'v9.0.1995
Problem: Invalid memory access when 'foldexpr' returns empty string.
Solution: Check for NUL.
closes: #13293
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index 19ab01561d..a9f7112f2d 100644 --- a/src/eval.c +++ b/src/eval.c @@ -968,7 +968,7 @@ eval_foldexpr(win_T *wp, int *cp) // If the result is a string, check if there is a non-digit before // the number. s = tv.vval.v_string; - if (!VIM_ISDIGIT(*s) && *s != '-') + if (*s != NUL && !VIM_ISDIGIT(*s) && *s != '-') *cp = *s++; retval = atol((char *)s); } |