Return an error if the serial number is badly formed. (Coverity ID 116).
authorBen Laurie <ben@openssl.org>
Wed, 4 Apr 2007 14:35:56 +0000 (14:35 +0000)
committerBen Laurie <ben@openssl.org>
Wed, 4 Apr 2007 14:35:56 +0000 (14:35 +0000)
apps/ca.c

index 7666e35d54a69c2536137d546509f60a40eea08e..291f16487a0f40e0d6e56e5aefd7e402d9a25a6a 100644 (file)
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -2406,6 +2406,8 @@ static int do_revoke(X509 *x509, CA_DB *db, int type, char *value)
                row[i]=NULL;
        row[DB_name]=X509_NAME_oneline(X509_get_subject_name(x509),NULL,0);
        bn = ASN1_INTEGER_to_BN(X509_get_serialNumber(x509),NULL);
+       if (!bn)
+               goto err;
        if (BN_is_zero(bn))
                row[DB_serial]=BUF_strdup("00");
        else