csi: XTPUSHCOLORS: limit stack depth to 128

Closes #2362
This commit is contained in:
Daniel Eklöf 2026-06-24 13:12:53 +02:00
parent e24ad0a793
commit 671483674e
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

2
csi.c
View file

@ -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(