Skip to content

Decompress sometime lead to additional garbage data #232

@sidd1809

Description

@sidd1809

Issue starting in version: v4.1.1 onwards
Last working Version: v4.1.0

We recently upgraded our lz4 library from v2.6.1+incompatible to v4.1.22 and started noticing data mismatch on decompression. Identified a missed edge-case handling where Decompress/Read patterns could return 0 data length, which currently ends up leaking a previously decompressed data frame buffer.

Fix: Trim data frame buffer when it is by-passed for received buffer in a Read(recvBuf []byte) call.

Testing:

  • Ran all existing unit tests
  • Similar benchmark number.
  • Have added a unit test that consistently reproduced the data mismatch error on data size in multiple of 20MB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions