asomers/blosc-rs

This crate allows copying values of arbitrary type

Closed this issue · 1 comments

This crate allows copying values of arbitrary type, which can lead to double free.

Only values that are Copy should be allowed to be compressed/decompressed.

Example:

fn main() {
    let data: Vec<String> = vec!["string".into()];
    let ctx = blosc::Context::new();
    let compressed = ctx.compress(&data);
    let decompressed = blosc::decompress(&compressed).unwrap();

    drop(data);
    drop(decompressed); // Double free
}

Nice find! it should be fixed by the linked PR.