[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
PATCH: smtpserver/smtptls.c
- To: zmailer@nic.funet.fi
- Subject: PATCH: smtpserver/smtptls.c
- From: "Darryl L. Miles" <darryl@netbauds.net>
- Date: Thu, 06 Apr 2006 14:23:43 +0100
- Original-Recipient: rfc822;zmailer-log@nic.funet.fi
- Sender: zmailer-owner@nic.funet.fi
- User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-GB; rv:1.8) Gecko/20051219 SeaMonkey/1.0b
This fixes data lifecycle, the returned reference from OpenSSL is owned
by the library, so this brings the data into line with the rest fixing
the glibc double free error.
Index: smtptls.c
===================================================================
RCS file: /cvsroot/zmailer/smtpserver/smtptls.c,v
retrieving revision 1.37
diff -u -r1.37 smtptls.c
--- smtptls.c 2 Jul 2005 01:19:38 -0000 1.37
+++ smtptls.c 6 Apr 2006 13:16:47 -0000
@@ -1293,6 +1293,7 @@
SSL_CIPHER * cipher;
X509 * peer;
char cbuf[4000];
+ const char * kp;
BIO *wbio, *rbio;
BIO_METHOD *rbiomethod_old;
@@ -1581,9 +1582,17 @@
/*
* Finally, collect information about protocol and cipher for logging
*/
- SS->TLS.protocol = SSL_get_version(SS->TLS.ssl);
+ kp = SSL_get_version(SS->TLS.ssl);
+ if (kp)
+ SS->TLS.protocol = strdup(kp);
+ else
+ SS->TLS.protocol = NULL;
cipher = SSL_get_current_cipher(SS->TLS.ssl);
- SS->TLS.cipher_name = SSL_CIPHER_get_name(cipher);
+ kp = SSL_CIPHER_get_name(cipher);
+ if (kp)
+ SS->TLS.cipher_name = strdup(kp);
+ else
+ SS->TLS.cipher_name = NULL;
SS->TLS.cipher_usebits = SSL_CIPHER_get_bits(cipher,
&SS->TLS.cipher_algbits);
--
Darryl L. Miles
-
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to majordomo@nic.funet.fi