From 0ff3250f05e5972ddf98599913c4cbec5d93a5dd Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Thu, 18 Jul 2002 17:59:27 +0000 Subject: [PATCH] Allow subjects with more than 255 characters to be properly printed. PR: 147 --- apps/apps.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/apps.c b/apps/apps.c index a7aa9fce08..618e34c084 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -762,7 +762,7 @@ int set_name_ex(unsigned long *flags, const char *arg) void print_name(BIO *out, char *title, X509_NAME *nm, unsigned long lflags) { - char buf[256]; + char *buf; char mline = 0; int indent = 0; if(title) BIO_puts(out, title); @@ -771,9 +771,10 @@ void print_name(BIO *out, char *title, X509_NAME *nm, unsigned long lflags) indent = 4; } if(lflags == XN_FLAG_COMPAT) { - X509_NAME_oneline(nm,buf,256); - BIO_puts(out,buf); + buf = X509_NAME_oneline(nm, 0, 0); + BIO_puts(out, buf); BIO_puts(out, "\n"); + OPENSSL_free(buf); } else { if(mline) BIO_puts(out, "\n"); X509_NAME_print_ex(out, nm, indent, lflags); -- 2.25.1