Add verify callback functions to lookup a STACK of matching certs or CRLs
[oweals/openssl.git] / crypto / asn1 / a_object.c
index 0fbc368f0db569ec3a051ad4603007db439872b0..6a421a66a639c428da810779b6b95d977ca37fc4 100644 (file)
@@ -246,6 +246,8 @@ int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a)
                        return -1;
                i2t_ASN1_OBJECT(p,i + 1,a);
                }
+       if (i <= 0)
+               return BIO_write(bp, "<INVALID>", 9);
        BIO_write(bp,p,i);
        if (p != buf)
                OPENSSL_free(p);
@@ -278,8 +280,6 @@ ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
        return ret;
 err:
        ASN1err(ASN1_F_D2I_ASN1_OBJECT,i);
-       if ((ret != NULL) && ((a == NULL) || (*a != ret)))
-               ASN1_OBJECT_free(ret);
        return(NULL);
 }
 ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,