mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
dcs: DECRQSS: fix off-by-one when checking for space in the DCS buffer
This commit is contained in:
parent
09e45794bc
commit
9287946b36
2 changed files with 3 additions and 1 deletions
|
|
@ -64,6 +64,8 @@
|
||||||
* When closing the window, send `SIGHUP` to the client application,
|
* When closing the window, send `SIGHUP` to the client application,
|
||||||
before sending `SIGTERM`. The signal sequence is now `SIGHUP`, wait,
|
before sending `SIGTERM`. The signal sequence is now `SIGHUP`, wait,
|
||||||
`SIGTERM`, wait `SIGKILL`.
|
`SIGTERM`, wait `SIGKILL`.
|
||||||
|
* Crash when receiving a `DECRQSS` request with more than 2 bytes in
|
||||||
|
the `q` parameter.
|
||||||
|
|
||||||
[1666]: https://codeberg.org/dnkl/foot/issues/1666
|
[1666]: https://codeberg.org/dnkl/foot/issues/1666
|
||||||
|
|
||||||
|
|
|
||||||
2
dcs.c
2
dcs.c
|
|
@ -239,7 +239,7 @@ decrqss_put(struct terminal *term, uint8_t c)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
struct vt *vt = &term->vt;
|
struct vt *vt = &term->vt;
|
||||||
if (vt->dcs.idx > 2)
|
if (vt->dcs.idx >= 2)
|
||||||
return;
|
return;
|
||||||
vt->dcs.data[vt->dcs.idx++] = c;
|
vt->dcs.data[vt->dcs.idx++] = c;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue