go/src/encoding
David Benjamin 7f96e266ec encoding/asn1: fix off-by-one in parseBase128Int.
parseBase128Int compares |shifted| with four, seemingly to ensure the result
fits in an int32 on 32-bit platforms where int is 32-bit. However, there is an
off-by-one in this logic, so it actually allows five shifts, making the maximum
tag number or OID component 2^35-1.

Fix this so the maximum is 2^28-1 which should be plenty for OID components and
tag numbers while not overflowing on 32-bit platforms.

Change-Id: If825b30cc53a0fc08e68ea1a24d265e7eb1a13a4
Reviewed-on: https://go-review.googlesource.com/18225
Reviewed-by: Adam Langley <agl@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2016-01-06 01:41:27 +00:00
..
ascii85
asn1 encoding/asn1: fix off-by-one in parseBase128Int. 2016-01-06 01:41:27 +00:00
base32
base64 encoding/base64: add package-level example 2015-12-01 23:12:09 +00:00
binary encoding/binary: document that Read returns io.EOF iff zero bytes are read 2015-09-30 22:10:44 +00:00
csv encoding/csv: indicate package of EOF in docs 2015-10-14 00:46:21 +00:00
gob encoding/gob: document behavior of zero-valued arrays, slices, and maps 2015-12-07 20:41:31 +00:00
hex
json encoding/json: document Indent's preservation of trailing spaces 2015-12-08 19:26:26 +00:00
pem encoding/pem: make TestFuzz testing/quick safe 2015-12-08 19:27:20 +00:00
xml encoding/xml: document new chardata tag 2015-12-03 14:47:57 +00:00
encoding.go