F-14015 - Fail TPM2_ParsePublic on packet overflow

pull/608/head
Aidan Garske 2026-09-14 10:00:30 -07:00
parent a84cb5f31f
commit 0fb80e09ac
1 changed files with 6 additions and 0 deletions

View File

@ -7648,8 +7648,14 @@ int TPM2_ParsePublic(TPM2B_PUBLIC* pub, byte* buf, word32 size, int* sizeUsed)
packet.buf = buf;
packet.pos = 0;
packet.size = (int)size;
packet.overflow = 0;
TPM2_Packet_ParsePublic(&packet, pub);
if (packet.overflow) {
*sizeUsed = 0;
return TPM_RC_SIZE;
}
*sizeUsed = packet.pos;
return TPM_RC_SUCCESS;