diff --git a/src/tpm2/RuntimeCommands.c b/src/tpm2/RuntimeCommands.c index 7af67fe6..4752b31d 100644 --- a/src/tpm2/RuntimeCommands.c +++ b/src/tpm2/RuntimeCommands.c @@ -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)); }