mirror of
https://github.com/stefanberger/libtpms
synced 2026-01-26 10:22:50 +00:00
tpm2: ExecuteCommand: Handle unreasonably large command sizes
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
4bee97102b
commit
c235a90932
@ -111,6 +111,12 @@ ExecuteCommand(
|
||||
// Response local variables
|
||||
UINT32 maxResponse = *responseSize;
|
||||
TPM_RC result; // return code for the command
|
||||
|
||||
/* check for an unreasonably large command size, since it's cast to a signed integer later */
|
||||
if (requestSize > INT32_MAX) {
|
||||
result = TPM_RC_SUCCESS;
|
||||
goto Cleanup;
|
||||
}
|
||||
// This next function call is used in development to size the command and response
|
||||
// buffers. The values printed are the sizes of the internal structures and
|
||||
// not the sizes of the canonical forms of he command response structures. Also,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user