Fixed a crash in print_notice.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2935)
This commit is contained in:
Bernd Edlinger 2017-03-14 15:10:52 +01:00 committed by Rich Salz
parent dda12ce4e5
commit 29d1fad788

View file

@ -413,9 +413,15 @@ static void print_notice(BIO *out, USERNOTICE *notice, int indent)
num = sk_ASN1_INTEGER_value(ref->noticenos, i); num = sk_ASN1_INTEGER_value(ref->noticenos, i);
if (i) if (i)
BIO_puts(out, ", "); BIO_puts(out, ", ");
tmp = i2s_ASN1_INTEGER(NULL, num); if (num == NULL)
BIO_puts(out, tmp); BIO_puts(out, "(null)");
OPENSSL_free(tmp); else {
tmp = i2s_ASN1_INTEGER(NULL, num);
if (tmp == NULL)
return;
BIO_puts(out, tmp);
OPENSSL_free(tmp);
}
} }
BIO_puts(out, "\n"); BIO_puts(out, "\n");
} }