mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 06:15:21 +00:00
std.compress.zstandard: fix content size check
This commit is contained in:
parent
6d48b055af
commit
55e6e9409c
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user