Skip to content

Commit d20af38

Browse files
committed
Fix Fenrir F-1755/F-1762: wolfTPM2_NVReadAuthPolicy read size check
1 parent 681e1dd commit d20af38

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/tpm2_wrap.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5233,6 +5233,10 @@ int wolfTPM2_NVReadAuthPolicy(WOLFTPM2_DEV* dev, WOLFTPM2_SESSION* tpmSession,
52335233
}
52345234

52355235
toread = out.data.size;
5236+
if (toread > dataSz) {
5237+
rc = BAD_FUNC_ARG;
5238+
break;
5239+
}
52365240
if (dataBuf) {
52375241
XMEMCPY(&dataBuf[pos], out.data.buffer, toread);
52385242
}

0 commit comments

Comments
 (0)