summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2023-01-04 14:31:49 +0000
committerBram Moolenaar <Bram@vim.org>2023-01-04 14:31:49 +0000
commit7b17eb4b063a234376c1ec909ee293e42cff290c (patch)
treef994c89ecf171083a5d8e5a718a21626a7ba5e08 /src/buffer.c
parentf057171d8b562c72334fd7c15c89ff787358ce3a (diff)
patch 9.0.1143: invalid memory access with bad 'statusline' valuev9.0.1143
Problem: Invalid memory access with bad 'statusline' value. Solution: Avoid going over the NUL at the end.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 9856898789..4016822616 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4617,6 +4617,8 @@ build_stl_str_hl(
#endif
if (vim_strchr(STL_ALL, *s) == NULL)
{
+ if (*s == NUL) // can happen with "%0"
+ break;
s++;
continue;
}