# zstd.Decompress: Treat a partial magic number as a failure · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/60b0b2129664d6e97822c8ce815518c6a48f9203)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 60b0b2129664d6e97822c8ce815518c6a48f9203

Requested commit: 60b0b2129664d6e97822c8ce815518c6a48f9203

Commit: 60b0b2129664d6e97822c8ce815518c6a48f9203

Tree: 451da90a263939d8aa45e9e6f0dedf7cdaf276fe

Author: Ryan Liptak

Committer: Ryan Liptak

## Message

```
zstd.Decompress: Treat a partial magic number as a failure

Previously, the "allow EndOfStream" part of this logic was too permissive. If there are a few dangling bytes at the end of the stream, that should be treated as a bad magic number. The only case where EndOfStream is allowed is when the stream is truly at the end, with exactly zero bytes available.

```

## Parents

- [59de7e3a5725f0c4eeb64bc464db85e019af7446](https://git.cafe/gitcafe/zig/commit/59de7e3a5725f0c4eeb64bc464db85e019af7446?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/60b0b2129664d6e97822c8ce815518c6a48f9203?format=markdown)
