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_0_2i~90 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=32baafb2f6fb2a424824df08232d86765f554880;p=oweals%2Fopenssl.git Return error when trying to print invalid ASN1 integer GH: #1322 (cherry picked from commit 5e3553c2de9a365479324b8ba8b998f0cce3e527) Reviewed-by: Rich Salz Reviewed-by: Stephen Henson --- diff --git a/crypto/asn1/tasn_prn.c b/crypto/asn1/tasn_prn.c index 1dae46bc3d..f628caddbd 100644 --- a/crypto/asn1/tasn_prn.c +++ b/crypto/asn1/tasn_prn.c @@ -447,6 +447,8 @@ static int asn1_print_integer_ctx(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);