]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/x509: don't ignore asn1.Marshal error
authorIan Lance Taylor <iant@golang.org>
Tue, 7 Jun 2016 16:42:48 +0000 (09:42 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 14 Jun 2016 05:17:57 +0000 (05:17 +0000)
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>
src/crypto/x509/x509.go

index 9e6d67df55fc94595c4315c3dfffa1d3a3313b63..9ad3cf23f655a9c3ee25665162cc7f951e1e65c9 100644 (file)
@@ -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