Always check that the value returned by asn1_do_adb() is non-NULL
authorRichard Levitte <levitte@openssl.org>
Tue, 14 Jun 2016 21:54:56 +0000 (23:54 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 14 Jun 2016 23:36:11 +0000 (01:36 +0200)
Reviewed-by: Stephen Henson <steve@openssl.org>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
crypto/asn1/tasn_dec.c

index aad838a083003a8cecb7e8f7fac896b2f7c1e8c3..64518ee24e213fb3e86e2c53c01db84e8118d15f 100644 (file)
@@ -301,6 +301,8 @@ static int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in,
                 const ASN1_TEMPLATE *seqtt;
                 ASN1_VALUE **pseqval;
                 seqtt = asn1_do_adb(pval, tt, 1);
+                if (!seqtt)
+                    continue;
                 pseqval = asn1_get_field_ptr(pval, seqtt);
                 asn1_template_free(pseqval, seqtt);
             }