prometheus/tsdb/index
Oleg Zaytsev 5e746e4e88
Check postings bytes length when decoding (#9766)
Added validation to expected postings length compared to the bytes slice
length. With 32bit postings, we expect to have 4 bytes per each posting.
If the number doesn't add up, we know that the input data is not
compatible with our code (maybe it's cut, or padded with trash, or even
written in a different coded).

This is needed in downstream projects to correctly identify cached
postings written with an unknown codec, but it's also a good idea to
validate it here.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2021-11-24 15:26:37 +05:30
..
index.go Check postings bytes length when decoding (#9766) 2021-11-24 15:26:37 +05:30
index_test.go Check postings bytes length when decoding (#9766) 2021-11-24 15:26:37 +05:30
postings.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
postings_test.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
postingsstats.go Format Go source files using 'gofumpt -w -s -extra' 2021-11-02 19:52:34 +01:00
postingsstats_test.go Format Go source files using 'gofumpt -w -s -extra' 2021-11-02 19:52:34 +01:00