dcs: DECRQSS: fix off-by-one when checking for space in the DCS buffer

This commit is contained in:
Daniel Eklöf 2024-04-10 05:44:33 +02:00
parent 09e45794bc
commit 9287946b36
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 3 additions and 1 deletions

2
dcs.c
View file

@ -239,7 +239,7 @@ decrqss_put(struct terminal *term, uint8_t c)
return;
struct vt *vt = &term->vt;
if (vt->dcs.idx > 2)
if (vt->dcs.idx >= 2)
return;
vt->dcs.data[vt->dcs.idx++] = c;
}