aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2016-06-07 09:42:48 -0700
committerIan Lance Taylor <iant@golang.org>2016-06-14 05:17:57 +0000
commit53242e49b127ede6d7b258c7e90c39a5afa70c25 (patch)
tree466696018e5993016b2a1d3cf7a7988ba6ab48bb
parent0deb49f9c09d15bf0e4c5ec843bd374f9a377e97 (diff)
downloadgo-53242e49b127ede6d7b258c7e90c39a5afa70c25.tar.gz
go-53242e49b127ede6d7b258c7e90c39a5afa70c25.zip
crypto/x509: don't ignore asn1.Marshal error
I don't see how the call could fail, so, no test. Just a code cleanup in case it can fail in the future. Fixes #15987. Change-Id: If4af0d5e7d19cc8b13fb6a4f7661c37fb0015e83 Reviewed-on: https://go-review.googlesource.com/23860 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
-rw-r--r--src/crypto/x509/x509.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/crypto/x509/x509.go b/src/crypto/x509/x509.go
index 9e6d67df55..9ad3cf23f6 100644
--- a/src/crypto/x509/x509.go
+++ b/src/crypto/x509/x509.go
@@ -1796,6 +1796,9 @@ var oidExtensionRequest = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 14}
func newRawAttributes(attributes []pkix.AttributeTypeAndValueSET) ([]asn1.RawValue, error) {
var rawAttributes []asn1.RawValue
b, err := asn1.Marshal(attributes)
+ if err != nil {
+ return nil, err
+ }
rest, err := asn1.Unmarshal(b, &rawAttributes)
if err != nil {
return nil, err