mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-07 05:59:50 +00:00
tpm2: Check valid range of command code before conversion to index
Check the range of the (untrusted) command code before converting it to a command index. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
de20bf4779
commit
cea0585f5c
@ -415,6 +415,8 @@ LIB_EXPORT BOOL
|
||||
RuntimeCommandsCheckEnabled(struct RuntimeCommands *RuntimeCommands,
|
||||
TPM_CC cc)
|
||||
{
|
||||
if (cc > TPM_CC_LAST || cc < TPM_CC_FIRST)
|
||||
return FALSE;
|
||||
return RuntimeCommandsCheckEnabledByIdx(RuntimeCommands, CcToIdx(cc));
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user