Skip to content

Commit

Permalink
Fix bound check
Browse files Browse the repository at this point in the history
  • Loading branch information
flanglet committed Dec 12, 2021
1 parent 2a28195 commit 049a658
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion transform/LZCodec.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func (this *LZXCodec) Forward(src, dst []byte) (uint, uint, error) {

// Find a match
if binary.LittleEndian.Uint32(src[srcIdx:]) == binary.LittleEndian.Uint32(src[ref:]) {
maxMatch := srcEnd - srcIdx
maxMatch := srcEnd - srcIdx - 4

if maxMatch > _LZX_MAX_MATCH {
maxMatch = _LZX_MAX_MATCH
Expand Down

0 comments on commit 049a658

Please sign in to comment.