std.compress.zstandard: fix content size check

This commit is contained in:
dweiller 2023-02-09 18:52:48 +11:00
parent 6d48b055af
commit 55e6e9409c

View File

@ -421,14 +421,14 @@ pub fn decodeZstandardFrameBlocksArrayList(
hasher.update(written_slice.second);
}
}
const added_len = dest.items.len - initial_len;
if (frame_context.content_size) |size| {
if (added_len != size) {
return error.BadContentSize;
}
}
if (block_header.last_block) break;
}
const added_len = dest.items.len - initial_len;
if (frame_context.content_size) |size| {
if (added_len != size) {
return error.BadContentSize;
}
}
if (frame_context.has_checksum) {
if (src.len < consumed_count + 4) return error.EndOfStream;