From 5e3553c2de9a365479324b8ba8b998f0cce3e527 Mon Sep 17 00:00:00 2001 From: Kurt Roeckx Date: Sat, 16 Jul 2016 16:56:54 +0200 Subject: [PATCH] Return error when trying to print invalid ASN1 integer Reviewed-by: Rich Salz GH: #1322 --- crypto/asn1/tasn_prn.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.25.1