From 671483674edea062f2ba7d55282e7d96001fc7a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 24 Jun 2026 13:12:53 +0200 Subject: [PATCH] csi: XTPUSHCOLORS: limit stack depth to 128 Closes #2362 --- csi.c | 2 ++ 1 file changed, 2 insertions(+) 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(