From: Kurt Roeckx Date: Sat, 16 Jul 2016 14:56:54 +0000 (+0200) Subject: Return error when trying to print invalid ASN1 integer X-Git-Tag: OpenSSL_1_1_0-pre6~216 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5e3553c2de9a365479324b8ba8b998f0cce3e527;p=oweals%2Fopenssl.git Return error when trying to print invalid ASN1 integer Reviewed-by: Rich Salz GH: #1322 --- diff --git a/crypto/asn1/tasn_prn.c b/crypto/asn1/tasn_prn.c index 9f4c81e005..930ef97a9e 100644 --- a/crypto/asn1/tasn_prn.c +++ b/crypto/asn1/tasn_prn.c @@ -393,6 +393,8 @@ static int asn1_print_integer(BIO *out, ASN1_INTEGER *str) char *s; int ret = 1; s = i2s_ASN1_INTEGER(NULL, str); + if (s == NULL) + return 0; if (BIO_puts(out, s) <= 0) ret = 0; OPENSSL_free(s);