1
0
mirror of https://github.com/golang/go synced 2024-10-04 09:31:22 -06:00
go/src/image/png
Nathan Otterness 66c25fa9be image/png: integer underflow when decoding
This change addresses an integer underflow appearing only on systems
using a 32-bit int type. The patch addresses the problem by limiting the
length of unknown chunks to 0x7fffffff. This value appears to already be
checked for when parsing other chunk types, so the bug shouldn't appear
elsewhere in the package. The PNG spec recommends the maximum size for
any chunk to remain under 2^31, so this shouldn't cause errors with
valid images.

Fixes #12687

Change-Id: I17f0e1683515532c661cf2b0b2bc65309d1b7bb7
Reviewed-on: https://go-review.googlesource.com/14766
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-09-21 23:09:22 +00:00
..
testdata image/png: don't read filter bytes for empty interlace passes. 2015-07-13 06:40:00 +00:00
paeth_test.go
paeth.go
reader_test.go image/png: integer underflow when decoding 2015-09-21 23:09:22 +00:00
reader.go image/png: integer underflow when decoding 2015-09-21 23:09:22 +00:00
writer_test.go
writer.go