aboutsummaryrefslogtreecommitdiff
path: root/csi.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2026-06-24 11:12:53 +0000
committerDaniel Eklöf <daniel@ekloef.se>2026-06-24 11:16:34 +0000
commit671483674edea062f2ba7d55282e7d96001fc7a2 (patch)
tree3f217a77635cf451480cee30435f3ebe2cd4c141 /csi.c
parentcsi: clamp REP count to scrollback-lines * cols (diff)
csi: XTPUSHCOLORS: limit stack depth to 128
Closes #2362
Diffstat (limited to 'csi.c')
-rw-r--r--csi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/csi.c b/csi.c
index 68825760..0593ede0 100644
--- a/csi.c
+++ b/csi.c
@@ -2146,6 +2146,8 @@ csi_dispatch(struct terminal *term, uint8_t final)
if (slot == 0)
slot = term->color_stack.idx + 1;
+ slot = min(slot, 128);
+
if (term->color_stack.size < slot) {
const size_t new_size = slot;
term->color_stack.stack = xrealloc(