]> Cypherpunks repositories - gostls13.git/commit
encoding/asn1: don't parse invalid UTF-8.
authorAdam Langley <agl@golang.org>
Sat, 13 Jun 2015 20:50:02 +0000 (13:50 -0700)
committerRuss Cox <rsc@golang.org>
Mon, 29 Jun 2015 02:50:49 +0000 (02:50 +0000)
commit0a6df4a87b8333e1029c1940c84e39fad66352fa
tree426e5295f4ea9745056c0d8ff77330c8c07e89da
parentfdd921c9f40f75843838d8f0218106cf078810ed
encoding/asn1: don't parse invalid UTF-8.

Invalid UTF-8 triggers an error when marshaling but, previously, not
when unmarshaling. This means that ASN.1 structures were not
round-tripping.

This change makes invalid UTF-8 in a string marked as UTF-8 to be an
error when Unmarshaling.

Fixes #11126.

Change-Id: Ic37be84d21dc5c03983525e244d955a8b1e1ff14
Reviewed-on: https://go-review.googlesource.com/11056
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/encoding/asn1/asn1.go
src/encoding/asn1/asn1_test.go