summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorKurt Roeckx <kurt@roeckx.be>2016-07-16 16:56:54 +0200
committerKurt Roeckx <kurt@roeckx.be>2016-07-16 21:51:49 +0200
commit5e3553c2de9a365479324b8ba8b998f0cce3e527 (patch)
tree2afde55fd34d9c9bd6e341952f78ec095e93ce3c /crypto
parent85afea67f5e48dc4f02ac100454ec3caa41aa647 (diff)
Return error when trying to print invalid ASN1 integer
Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1322
Diffstat (limited to 'crypto')
-rw-r--r--crypto/asn1/tasn_prn.c2
1 files changed, 2 insertions, 0 deletions
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);