File CVE-2021-3712-Fix-read-buffer-overrun-in-X509_aux_print.patch of Package openssl-1_1.21009

Index: openssl-1.1.0i/crypto/x509/t_x509.c
===================================================================
--- openssl-1.1.0i.orig/crypto/x509/t_x509.c
+++ openssl-1.1.0i/crypto/x509/t_x509.c
@@ -362,9 +362,9 @@ int X509_aux_print(BIO *out, X509 *x, in
         BIO_puts(out, "\n");
     } else
         BIO_printf(out, "%*sNo Rejected Uses.\n", indent, "");
-    alias = X509_alias_get0(x, NULL);
+    alias = X509_alias_get0(x, &i);
     if (alias)
-        BIO_printf(out, "%*sAlias: %s\n", indent, "", alias);
+        BIO_printf(out, "%*sAlias: %.*s\n", indent, "", i, alias);
     keyid = X509_keyid_get0(x, &keyidlen);
     if (keyid) {
         BIO_printf(out, "%*sKey Id: ", indent, "");
openSUSE Build Service is sponsored by