diff options
author | Ben Laurie <ben@openssl.org> | 2002-11-13 15:43:43 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2002-11-13 15:43:43 +0000 |
commit | 54a656ef081f72a740c550ebd8099b40b8b5cde0 (patch) | |
tree | 9b3638b56848c7f0648b84cfa7ad056116b37a1b /crypto/asn1/t_x509.c | |
parent | 8f797f14b8ff7d3d5cb04443284259a0c94860b3 (diff) |
Security fixes brought forward from 0.9.7.
Diffstat (limited to 'crypto/asn1/t_x509.c')
-rw-r--r-- | crypto/asn1/t_x509.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crypto/asn1/t_x509.c b/crypto/asn1/t_x509.c index 5074a74928..7bf2866150 100644 --- a/crypto/asn1/t_x509.c +++ b/crypto/asn1/t_x509.c @@ -444,15 +444,17 @@ err: int X509_NAME_print(BIO *bp, X509_NAME *name, int obase) { - char *s,*c; + char *s,*c,*b; int ret=0,l,ll,i,first=1; - char buf[256]; ll=80-2-obase; - s=X509_NAME_oneline(name,buf,256); + b=s=X509_NAME_oneline(name,NULL,0); if (!*s) + { + free(b); return 1; + } s++; /* skip the first slash */ l=ll; @@ -508,6 +510,7 @@ int X509_NAME_print(BIO *bp, X509_NAME *name, int obase) err: X509err(X509_F_X509_NAME_PRINT,ERR_R_BUF_LIB); } + free(b); return(ret); } |