On Mon, Aug 12, 2002 at 06:44:26PM +0200, Geoff Thorpe via RT wrote:
> yup, I fixed some similar things in [RSA|DSA|<etc>]_free() functions a
> while ago. Those cases were more clear-cut though, because the
> structures in question had virtual-function tables ("methods") with
> finish() handlers (destructors) - distructor callbacks are a clearer
> case than callback hooks into a single member variable's cleanup.
>
> Let me clarify my point, it's not immediately clear to me whether the
> SSL_CTX_flush_sessions() and lh_free() should occur before the ex_data
> cleanup - eg. what if someone registered an ex_data index for the
> SSL_CTX type with a non-NULL "free" callback? In particular, what if
> there's a "free" ex_data callback invoked by the CRYPTO_free_ex_data()
> function that needs "a->sessions"? :-)
>
> I think it's unlikely, but I'd guess off the top of my head that
> something like the following would be less risky;
>
> if (a->sessions != NULL)
> SSL_CTX_flush_sessions(a,0);
>
> CRYPTO_free_ex_data(ssl_ctx_meth,(char *)a,&a->ex_data);
>
> if (a->sessions != NULL)
> lh_free(a->sessions);
>
> how does that look to you? Any of the more SSL-savvy hackers out there
> have any comments? The code in ssl/ can bite some times ...
Makes sense to me. I consider this to be a bugfix, such that it might
make its way into 0.9.6-stable and later.
Geoff, are you going to commit it?
Best regards,
Lutz
--
Lutz Jaenicke [EMAIL PROTECTED]
http://www.aet.TU-Cottbus.DE/personen/jaenicke/
BTU Cottbus, Allgemeine Elektrotechnik
Universitaetsplatz 3-4, D-03044 Cottbus
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]