mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
dcs: xtgettcap: ignore queries with invalid hex encodings
When we receive an XTGETTCAP query, where the capability is not correctly hex encoded, ignore it. Before this patch, we echo:ed it back to the TTY inside an error resonse.
This commit is contained in:
parent
54722369d8
commit
8a5f2915e9
2 changed files with 6 additions and 7 deletions
11
dcs.c
11
dcs.c
|
|
@ -111,14 +111,11 @@ static void
|
|||
xtgettcap_reply(struct terminal *term, const char *hex_cap_name, size_t len)
|
||||
{
|
||||
char *name = hex_decode(hex_cap_name, len);
|
||||
if (name == NULL)
|
||||
goto err;
|
||||
if (name == NULL) {
|
||||
LOG_WARN("XTGETTCAP: invalid hex encoding, ignoring capability");
|
||||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
const struct foot_terminfo_entry *entry =
|
||||
bsearch(name, terminfo_capabilities, ALEN(terminfo_capabilities),
|
||||
sizeof(*entry), &terminfo_entry_compar);
|
||||
#endif
|
||||
const char *value;
|
||||
bool valid_capability = lookup_capability(name, &value);
|
||||
xassert(!valid_capability || value != NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue