Thanks for the tip. Now, how do we get this fix into an official codebase?

Yuval

-----Original Message-----
From: Harald Koch [mailto:[EMAIL PROTECTED]]
Sent: Mon, July 15, 2002 17:33
To: [EMAIL PROTECTED]
Subject: Re: [openssl.org #147] [PATCH] The function print_name in
apps/apps.c truncates X509_NAM Es that are longer than 255 characters 


Of all the gin joints in all the towns in all the world, Yuval Pemper
had to walk into mine and say:
> Another problem with my code: the buffer I allocated wasn't freed... 
> Thanks to Peter Sylvester for pointing this out. I also moved the 
> allocation of the buffer to where it's actually used.

What's wrong with:

        buf = X509_NAME_oneline(nm, NULL, 0);
        ...
        OPENSSL_free(buf);

(given those parameters, X509_NAME_oneline() will allocate a buffer of
the correct size and fill it for you. No complicated code required).

-- 
Harald Koch     <[EMAIL PROTECTED]>

"It takes a child to raze a village."
                -Michael T. Fry
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to