search: don’t crash when we don’t have any XKB compose state

This commit is contained in:
Daniel Eklöf 2021-06-16 17:44:14 +02:00
parent ee2b0cb21f
commit 11829931a7
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 5 additions and 2 deletions

View file

@ -180,6 +180,8 @@
* Memory leak caused by custom box drawing glyphs not being completely
freed when destroying a foot window instance
(https://codeberg.org/dnkl/foot/issues/586).
* Crash in scrollback search when current XKB layout is missing
_compose_ definitions.
### Security

View file

@ -798,8 +798,9 @@ search_input(struct seat *seat, struct terminal *term, uint32_t key,
{
LOG_DBG("search: input: sym=%d/0x%x, mods=0x%08x", sym, sym, mods);
enum xkb_compose_status compose_status = xkb_compose_state_get_status(
seat->kbd.xkb_compose_state);
enum xkb_compose_status compose_status = seat->kbd.xkb_compose_state != NULL
? xkb_compose_state_get_status(seat->kbd.xkb_compose_state)
: XKB_COMPOSE_NOTHING;
bool update_search_result = false;
bool redraw = false;