File CVE-2021-3712-Fix-read-buffer-overrun-in-X509_aux_print.patch of Package openssl-1_1.29122
Index: openssl-1.1.1d/crypto/x509/t_x509.c
===================================================================
--- openssl-1.1.1d.orig/crypto/x509/t_x509.c
+++ openssl-1.1.1d/crypto/x509/t_x509.c
@@ -365,9 +365,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, "");