From 53242e49b127ede6d7b258c7e90c39a5afa70c25 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 7 Jun 2016 09:42:48 -0700 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Mikio Hara --- src/crypto/x509/x509.go | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.50.0