Sending commands to not registered services is violation of IPC spec and should result in daemon shutdown. --- android/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/android/main.c b/android/main.c index 36cc8aa..12284f7 100644 --- a/android/main.c +++ b/android/main.c @@ -252,6 +252,12 @@ static gboolean cmd_watch_cb(GIOChannel *io, GIOCondition cond, DBG("service_id %u opcode %u len %u", msg->service_id, msg->opcode, msg->len); + if (msg->service_id > HAL_SERVICE_ID_MAX || + !services[msg->service_id]) { + error("HAL command of not registered service, terminating"); + goto fail; + } + switch (msg->service_id) { case HAL_SERVICE_ID_CORE: handle_service_core(msg->opcode, msg->payload, msg->len); -- 1.8.4.2 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html