Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tiff: don't pre-allocate giant slices before reading
Use a copy of the standard libraries internal/saferio.ReadDataAt func to create/read slices which have lengths supplied by the header. This avoids allocating giant slices which we then learn there are not enough bytes in the reader to fill. This makes DecodeConfig safe to use to determine if the image is of a reasonable size to call Decode on. This was found by the ngolo-fuzzing project running on OSS-Fuzz and reported by Philippe Antoine (Catena cyber). Fixes golang/go#58003 Fixes CVE-2022-41727 Change-Id: Iae53f78b840f3b8dbeab37fba8c0164054cbb4ed Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1680712 Reviewed-by: Damien Neil <dneil@google.com> TryBot-Result: Security TryBots <security-trybots@go-security-trybots.iam.gserviceaccount.com> Run-TryBot: Roland Shoemaker <bracewell@google.com> Reviewed-by: Julie Qiu <julieqiu@google.com> Reviewed-on: https://go-review.googlesource.com/c/image/+/468195 Auto-Submit: Roland Shoemaker <roland@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
- Loading branch information