Skip to content

pierrec/lz4 v4.1.23 breaks ltx #70

@ncruces

Description

@ncruces

Specifically, pierrec/lz4#229 (implementing frame concatenation) breaks this piece of code:

ltx/decoder.go

Lines 275 to 281 in 133c1b1

// readLZ4Trailer reads the LZ4 trailer frame to ensure we hit EOF.
func (dec *Decoder) readLZ4Trailer() error {
if _, err := io.ReadFull(dec.zr, make([]byte, 1)); err != io.EOF {
return fmt.Errorf("expected lz4 end frame")
}
return nil
}

readLZ4Trailer wants pierrec/lz4 to consume the trailer - and verify the checksum - but in doing so, it peeks into the subsequent data, finds an invalid signature, and errors out.

Even if you ignore that error, your stream is now in an invalid state to continue reading the next page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions