Sending commands to not registered services is violation of IPC spec
and should result in daemon shutdown.
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);