Skip to content

Commit 31ad4f5

Browse files
authored
Fix integer overflow in digest parsing (#211)
1 parent b89180c commit 31ad4f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

attest/eventlog.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ func parseRawEvent2(r *bytes.Buffer, specID *specIDEvent) (event rawEvent, err e
712712
if alg.ID != algID {
713713
continue
714714
}
715-
if uint16(r.Len()) < alg.Size {
715+
if r.Len() < int(alg.Size) {
716716
return event, fmt.Errorf("reading digest: %v", io.ErrUnexpectedEOF)
717717
}
718718
digest.data = make([]byte, alg.Size)

0 commit comments

Comments
 (0)