snowball: Restrict zstd window size (#16987)

This commit is contained in:
Klaus Post 2023-04-06 17:47:38 -07:00 committed by GitHub
parent 47b7469a60
commit 9803f68522
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -144,7 +144,8 @@ func untar(ctx context.Context, r io.Reader, putObject func(reader io.Reader, in
case formatS2:
r = s2.NewReader(bf)
case formatZstd:
dec, err := zstd.NewReader(bf)
// Limit to 16 MiB per stream.
dec, err := zstd.NewReader(bf, zstd.WithDecoderMaxWindow(16<<20))
if err != nil {
return err
}