diff --git a/src/ipc/handler.c b/src/ipc/handler.c index 429ae15c197f..b9f400ab7d62 100644 --- a/src/ipc/handler.c +++ b/src/ipc/handler.c @@ -121,8 +121,8 @@ struct sof_ipc_cmd_hdr *mailbox_validate(void) mailbox_hostbox_read(hdr, SOF_IPC_MSG_MAX_SIZE, 0, sizeof(*hdr)); /* validate component header */ - if (hdr->size > SOF_IPC_MSG_MAX_SIZE) { - trace_ipc_error("ipc: msg too big at 0x%x", hdr->size); + if (hdr->size < sizeof(*hdr) || hdr->size > SOF_IPC_MSG_MAX_SIZE) { + trace_ipc_error("ipc: invalid size 0x%x", hdr->size); return NULL; }