summaryrefslogtreecommitdiff
path: root/stubdom/vtpmmgr/vtpm_cmd_handler.c
diff options
context:
space:
mode:
Diffstat (limited to 'stubdom/vtpmmgr/vtpm_cmd_handler.c')
-rw-r--r--stubdom/vtpmmgr/vtpm_cmd_handler.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/stubdom/vtpmmgr/vtpm_cmd_handler.c b/stubdom/vtpmmgr/vtpm_cmd_handler.c
index c879b24c13..5586be6997 100644
--- a/stubdom/vtpmmgr/vtpm_cmd_handler.c
+++ b/stubdom/vtpmmgr/vtpm_cmd_handler.c
@@ -840,6 +840,12 @@ TPM_RESULT vtpmmgr_handle_cmd(
UINT32 size;
TPM_COMMAND_CODE ord;
+ if (tpmcmd->req_len < sizeof_TPM_RQU_HEADER(tpmcmd->req)) {
+ status = TPM_BAD_PARAMETER;
+ tag = TPM_TAG_RQU_COMMAND;
+ goto abort_egress;
+ }
+
unpack_TPM_RQU_HEADER(tpmcmd->req,
&tag, &size, &ord);