std.compress.zstandard: fix content size check
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user