mirror of https://github.com/prometheus/prometheus
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>pull/9855/head
parent
d9a8c453a0
commit
5e746e4e88
Loading…
Reference in new issue