]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Check return code of i2a_ASN1_OBJECT Closes #2310
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 20 Sep 2018 01:38:22 +0000 (09:38 +0800)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 20 Sep 2018 01:38:43 +0000 (09:38 +0800)
src/lib/tls/session.c

index ec93c800e9ecb81c6f5c431970633cbbc49fe2d0..2b1ac3eaa4e24100b1c6c6f9d729180478cf8e4c 100644 (file)
@@ -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;