From 304a2efb44ebfd0cd2cf6bbf09cb586a228f778e Mon Sep 17 00:00:00 2001 From: Jelmer de Hen <18084450+jelmerdehen@users.noreply.github.com> Date: Sun, 26 Apr 2026 04:04:27 +0200 Subject: [PATCH] fix(input): guard _sendEvent against null ui_device _enableEvent destroys and recreates the uinput device on every key or axis registration, and on failure leaves both 'device' and 'ui_device' set to nullptr while continuing to run. Subsequent press/release calls then dereferenced nullptr in libevdev_uinput_write_event, crashing the daemon. Skip writes when ui_device is null. --- src/logid/InputDevice.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/logid/InputDevice.cpp b/src/logid/InputDevice.cpp index 9d3169cb..ee490b95 100644 --- a/src/logid/InputDevice.cpp +++ b/src/logid/InputDevice.cpp @@ -178,6 +178,8 @@ void InputDevice::_enableEvent(const uint type, const uint code) { void InputDevice::_sendEvent(uint type, uint code, int value) { std::unique_lock lock(_input_mutex); + if (!ui_device) + return; libevdev_uinput_write_event(ui_device, type, code, value); libevdev_uinput_write_event(ui_device, EV_SYN, SYN_REPORT, 0); }