diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2026-06-24 11:06:16 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2026-06-24 11:06:16 +0000 |
| commit | e24ad0a793819b12929fadba53725cf5ec3826ab (patch) | |
| tree | 65e0efcff457a3bcce1020efeb388b9851f5f75e | |
| parent | csi: kitty: limit pop count to the size of the flag stack (diff) | |
csi: clamp REP count to scrollback-lines * cols
This can be quite a lot, but hopefully less than 0x7fffffff, which is
the max value a VT parameter can have...
Closes #2366
| -rw-r--r-- | csi.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -798,7 +798,8 @@ csi_dispatch(struct terminal *term, uint8_t final) * ECMA-48, the behaviour is undefined if REP was * _not_ preceded by a graphical character. */ - int count = vt_param_get(term, 0, 1); + const size_t max_count = term->grid->num_rows * term->cols; + int count = min(vt_param_get(term, 0, 1), max_count); LOG_DBG("REP: '%lc' %d times", (wint_t)term->vt.last_printed, count); int width; |
