Skip to content

Commit

Permalink
Fix regression in schema decompressor (#397)
Browse files Browse the repository at this point in the history
The io.CopyN function only copies up to N bytes, so this was failing for long schema elements. Reverted the change and disabled the lint check for this line.
  • Loading branch information
lblackstone authored Mar 17, 2022
1 parent 4592232 commit a325b2f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ CHANGELOG

## HEAD (Unreleased)

## 0.17.1 (2022-03-17)
Bug fixes:

- Fix regression in schema decompressor [#397](https://github.com/pulumi/pulumi-google-native/pull/397)

## 0.17.0 (2022-03-16)
Improvements:

Expand Down
4 changes: 3 additions & 1 deletion provider/pkg/gen/compression.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ func DecompressSchema(compressedSchema []byte) ([]byte, error) {
return nil, errors.Wrap(err, "expand compressed schema")
}
uncompressedBuf := bytes.Buffer{}
if _, err = io.CopyN(&uncompressedBuf, uncompressed, 1024); err != nil {
//nolint: gosec
// Ignore warning about decompression bomb since we control the input.
if _, err = io.Copy(&uncompressedBuf, uncompressed); err != nil {
return nil, err
}
if err = uncompressed.Close(); err != nil {
Expand Down

0 comments on commit a325b2f

Please sign in to comment.