Specifically, pierrec/lz4#229 (implementing frame concatenation) breaks this piece of code:
|
// 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.
Specifically, pierrec/lz4#229 (implementing frame concatenation) breaks this piece of code:
ltx/decoder.go
Lines 275 to 281 in 133c1b1
readLZ4Trailerwants 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.