diff options
author | Miloslav Trmač <mitr@redhat.com> | 2022-07-28 23:27:42 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2022-07-30 17:26:08 +0200 |
commit | 63d77da5b9b0578fcbfef927a7bd1579c6ed1198 (patch) | |
tree | 1e5bbdfff9f7f9fba1c135a73379479d9cb24232 /vendor/github.com/klauspost/compress/zstd/framedec.go | |
parent | b01478044b47ac07697a8db1b5eb7f7922b058cc (diff) | |
download | podman-63d77da5b9b0578fcbfef927a7bd1579c6ed1198.tar.gz podman-63d77da5b9b0578fcbfef927a7bd1579c6ed1198.tar.bz2 podman-63d77da5b9b0578fcbfef927a7bd1579c6ed1198.zip |
Update c/common to an unreleased version
... to get https://github.com/containers/common/pull/1106 .
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Diffstat (limited to 'vendor/github.com/klauspost/compress/zstd/framedec.go')
-rw-r--r-- | vendor/github.com/klauspost/compress/zstd/framedec.go | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/vendor/github.com/klauspost/compress/zstd/framedec.go b/vendor/github.com/klauspost/compress/zstd/framedec.go index fa0a633f3..9568a4ba3 100644 --- a/vendor/github.com/klauspost/compress/zstd/framedec.go +++ b/vendor/github.com/klauspost/compress/zstd/framedec.go @@ -106,7 +106,7 @@ func (d *frameDec) reset(br byteBuffer) error { } n := uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24) println("Skipping frame with", n, "bytes.") - err = br.skipN(int(n)) + err = br.skipN(int64(n)) if err != nil { if debugDecoder { println("Reading discarded frame", err) @@ -231,20 +231,27 @@ func (d *frameDec) reset(br byteBuffer) error { d.crc.Reset() } + if d.WindowSize > d.o.maxWindowSize { + if debugDecoder { + printf("window size %d > max %d\n", d.WindowSize, d.o.maxWindowSize) + } + return ErrWindowSizeExceeded + } + if d.WindowSize == 0 && d.SingleSegment { // We may not need window in this case. d.WindowSize = d.FrameContentSize if d.WindowSize < MinWindowSize { d.WindowSize = MinWindowSize } - } - - if d.WindowSize > uint64(d.o.maxWindowSize) { - if debugDecoder { - printf("window size %d > max %d\n", d.WindowSize, d.o.maxWindowSize) + if d.WindowSize > d.o.maxDecodedSize { + if debugDecoder { + printf("window size %d > max %d\n", d.WindowSize, d.o.maxWindowSize) + } + return ErrDecoderSizeExceeded } - return ErrWindowSizeExceeded } + // The minimum Window_Size is 1 KB. if d.WindowSize < MinWindowSize { if debugDecoder { |