mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-12-13 14:04:12 +08:00
android: Shutdown if IPC command for unregistered service is received
Sending commands to not registered services is violation of IPC spec and should result in daemon shutdown.
This commit is contained in:
parent
5cc87d0ab0
commit
33d823d2ee
@ -252,6 +252,13 @@ 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 for unregistered service %u, terminating",
|
||||
msg->service_id);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
switch (msg->service_id) {
|
||||
case HAL_SERVICE_ID_CORE:
|
||||
handle_service_core(msg->opcode, msg->payload, msg->len);
|
||||
|
Loading…
Reference in New Issue
Block a user