From: Arran Cudbard-Bell Date: Thu, 20 Sep 2018 01:38:22 +0000 (+0800) Subject: Check return code of i2a_ASN1_OBJECT Closes #2310 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c7ea4031337b2793b182e7e23ef8f4f4230bc06c;p=thirdparty%2Ffreeradius-server.git Check return code of i2a_ASN1_OBJECT Closes #2310 --- diff --git a/src/lib/tls/session.c b/src/lib/tls/session.c index ec93c800e9e..2b1ac3eaa4e 100644 --- a/src/lib/tls/session.c +++ b/src/lib/tls/session.c @@ -1068,7 +1068,11 @@ int tls_session_pairs_from_x509_cert(fr_cursor_t *cursor, TALLOC_CTX *ctx, ext = sk_X509_EXTENSION_value(ext_list, i); obj = X509_EXTENSION_get_object(ext); - i2a_ASN1_OBJECT(out, obj); + if (i2a_ASN1_OBJECT(out, obj) <= 0) { + RPWDEBUG("Skipping X509 Extension (%i) conversion to attribute. " + "Conversion from ASN1 failed...", i); + continue; + } len = BIO_read(out, attribute + 16 , sizeof(attribute) - 16 - 1); if (len <= 0) continue;