commit 756751afa3709b89f7525d5142fdd44bb3afdab1
parent b28bbee539625f9bcbf128e8da400d1d55b499ff
Author: phanium <91544758+phanen@users.noreply.github.com>
Date: Fri, 30 May 2025 19:57:07 +0800
fix(terminal): stack overflow when too many csi args (#34012)
fix: stack overflow when too many csi args
Problem:
Crash when csi contains > 16 args. It's easy to trigger
when you attempt to pipe external terminal scrollback buffer.
```sh
nvim --clean --cmd "term printf
'\e[38:2:59:66:97;48:2:36:40:59;58:2:224:175:104;4:3m'"
```
Solution:
Increase buffer size.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/nvim/vterm/vterm_internal_defs.h b/src/nvim/vterm/vterm_internal_defs.h
@@ -15,7 +15,7 @@
#define INTERMED_MAX 16
-#define CSI_ARGS_MAX 16
+#define CSI_ARGS_MAX 32
#define CSI_LEADER_MAX 16
#define BUFIDX_PRIMARY 0