From 7ca5c115d8182ddc25f415b977e23f7a3526898f Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Wed, 15 Jun 2016 19:18:49 +0200 Subject: [PATCH] validate all compressed buffers --- ethcore/src/snapshot/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ethcore/src/snapshot/mod.rs b/ethcore/src/snapshot/mod.rs index 8e5ca72b2..a1caa8e14 100644 --- a/ethcore/src/snapshot/mod.rs +++ b/ethcore/src/snapshot/mod.rs @@ -78,6 +78,8 @@ fn write_chunk(raw_data: &[u8], compression_buffer: &mut Vec, path: &Path) - let compressed = &compression_buffer[..compressed_size]; let hash = compressed.sha3(); + assert!(snappy::validate_compressed_buffer(compressed)); + let mut file_path = path.to_owned(); file_path.push(hash.hex());