Skip to content

Commit

Permalink
Fix integer overflow in digest parsing (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonweeks authored Apr 13, 2021
1 parent b89180c commit 31ad4f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion attest/eventlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ func parseRawEvent2(r *bytes.Buffer, specID *specIDEvent) (event rawEvent, err e
if alg.ID != algID {
continue
}
if uint16(r.Len()) < alg.Size {
if r.Len() < int(alg.Size) {
return event, fmt.Errorf("reading digest: %v", io.ErrUnexpectedEOF)
}
digest.data = make([]byte, alg.Size)
Expand Down

0 comments on commit 31ad4f5

Please sign in to comment.