diff options
| author | dweiller <4678790+dweiller@users.noreplay.github.com> | 2023-02-09 18:52:48 +1100 |
|---|---|---|
| committer | dweiller <4678790+dweiller@users.noreplay.github.com> | 2023-02-20 09:09:06 +1100 |
| commit | 55e6e9409c3c94cca6eb144388104cb03247b045 (patch) | |
| tree | 00874da3f10bdc921a2a69d17bc8faefb8d54122 /lib/std | |
| parent | 6d48b055af0cbe17e72426f808fa8408fce3eed6 (diff) | |
| download | zig-55e6e9409c3c94cca6eb144388104cb03247b045.tar.gz zig-55e6e9409c3c94cca6eb144388104cb03247b045.zip | |
std.compress.zstandard: fix content size check
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/compress/zstandard/decompress.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/std/compress/zstandard/decompress.zig b/lib/std/compress/zstandard/decompress.zig index fd783e3c9c..68d43c8aeb 100644 --- a/lib/std/compress/zstandard/decompress.zig +++ b/lib/std/compress/zstandard/decompress.zig @@ -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; |
