From 9f3d51106d026e9f234477d7600fcb6162edf4bc Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Fri, 13 Sep 2024 21:58:11 +0200 Subject: [PATCH] Remove fragile assert() The sc_uhid_devices instance is initialized only when there is a UHID keyboard. The device message receiver assumed that it could not receive HID output reports without a sc_uhid_devices instance (i.e. without a UHID keyboard), but in practice, a UHID driver implementation on the device may decide to send UHID output reports for mouse or for gamepads (and we must just ignore them). So remove the assert(). PR #5270 --- app/src/receiver.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/src/receiver.c b/app/src/receiver.c index 15cd05df..b89b0c6e 100644 --- a/app/src/receiver.c +++ b/app/src/receiver.c @@ -121,11 +121,6 @@ process_msg(struct sc_receiver *receiver, struct sc_device_msg *msg) { } } - // This is a programming error to receive this message if there is - // no uhid_devices instance - assert(receiver->uhid_devices); - - // Also check at runtime (do not trust the server) if (!receiver->uhid_devices) { LOGE("Received unexpected HID output message"); sc_device_msg_destroy(msg);