diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-16 19:21:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-16 19:21:06 +0800 |
commit | 88c3d8900112b1798fa5084dd02de6a6fd06f365 (patch) | |
tree | 2b782d03474e6e44ea68931dc7d62b5611d91f69 /src | |
parent | 227f06b7dfe52f3cb15a26ba990237af5014e2b6 (diff) | |
download | rneovim-88c3d8900112b1798fa5084dd02de6a6fd06f365.tar.gz rneovim-88c3d8900112b1798fa5084dd02de6a6fd06f365.tar.bz2 rneovim-88c3d8900112b1798fa5084dd02de6a6fd06f365.zip |
vim-patch:9.0.1143: invalid memory access with bad 'statusline' value (#23133)
Problem: Invalid memory access with bad 'statusline' value.
Solution: Avoid going over the NUL at the end.
https://github.com/vim/vim/commit/7b17eb4b063a234376c1ec909ee293e42cff290c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/statusline.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/statusline.c b/src/nvim/statusline.c index 05649e9b7f..feb67ad6fa 100644 --- a/src/nvim/statusline.c +++ b/src/nvim/statusline.c @@ -1373,6 +1373,9 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, char *opt_n // An invalid item was specified. // Continue processing on the next character of the format string. if (vim_strchr(STL_ALL, (uint8_t)(*fmt_p)) == NULL) { + if (*fmt_p == NUL) { // can happen with "%0" + break; + } fmt_p++; continue; } |