mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
dcs: XTGETTCAP: handle empty request
If the XTGETTCAP request is empty (no capabilities in it), reply with an empty error reply. Closes #1694
This commit is contained in:
parent
128c5c3efa
commit
4d4ef5eed5
2 changed files with 9 additions and 0 deletions
|
|
@ -62,6 +62,9 @@
|
|||
* Crash when zooming in or out, with `dpi-aware=yes`, and the
|
||||
monitor's DPI is 0 (this is true for, for example, nested Wayland
|
||||
sessions, or in virtualized environments).
|
||||
* No error response for empty `XTGETTCAP` request ([#1694][1694]).
|
||||
|
||||
[1694]: https://codeberg.org/dnkl/foot/issues/1694
|
||||
|
||||
|
||||
### Security
|
||||
|
|
|
|||
6
dcs.c
6
dcs.c
|
|
@ -200,6 +200,12 @@ xtgettcap_unhook(struct terminal *term)
|
|||
const char *const end = (const char *)&term->vt.dcs.data[left];
|
||||
const char *p = (const char *)term->vt.dcs.data;
|
||||
|
||||
if (p == NULL) {
|
||||
/* Request is empty; send an error reply, without any capabilities */
|
||||
term_to_slave(term, "\033P0+r\033\\", 7);
|
||||
return;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
const char *sep = memchr(p, ';', left);
|
||||
size_t cap_len;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue