patch 8.2.4009: reading one byte beyond the end of the line
Problem: Reading one byte beyond the end of the line.
Solution: Check for NUL byte first.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index cccf02c..f1a6a03 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -2781,7 +2781,8 @@
cmd = ea.cmd;
if ((*cmd != '$' || starts_with_colon)
&& (starts_with_colon || !(*cmd == '\''
- || (cmd[0] == cmd[1] && (*cmd == '+' || *cmd == '-')))))
+ || (cmd[0] != NUL && cmd[0] == cmd[1]
+ && (*cmd == '+' || *cmd == '-')))))
{
ea.cmd = skip_range(ea.cmd, TRUE, NULL);
if (ea.cmd > cmd)