mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 16:28:17 +00:00
vim-patch:9.0.1995: Invalid memory access with empty 'foldexpr' (#25530)
Problem: Invalid memory access when 'foldexpr' returns empty string.
Solution: Check for NUL.
closes: vim/vim#13293
a991ce9c08
This commit is contained in:
@@ -1299,7 +1299,7 @@ int eval_foldexpr(win_T *wp, int *cp)
|
||||
// If the result is a string, check if there is a non-digit before
|
||||
// the number.
|
||||
char *s = tv.vval.v_string;
|
||||
if (!ascii_isdigit(*s) && *s != '-') {
|
||||
if (*s != NUL && !ascii_isdigit(*s) && *s != '-') {
|
||||
*cp = (uint8_t)(*s++);
|
||||
}
|
||||
retval = atol(s);
|
||||
|
Reference in New Issue
Block a user