Skip to content

Commit

Permalink
bug checksum length checker
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-cha committed Sep 26, 2024
1 parent 62a4cf0 commit da27213
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion executor/types/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func UnmarshalBatchDataHeader(data []byte) (BatchDataHeader, error) {
return BatchDataHeader{}, err
}

if expectedLength != 0 || expectedLength != length {
if int64(len(data)-25)%32 != 0 || expectedLength != length {
err := fmt.Errorf("invalid checksum length: %d, data length: %d", length, len(data)-25)
return BatchDataHeader{}, err
}
Expand Down

0 comments on commit da27213

Please sign in to comment.