[ libetpan-Bugs-2897095 ] Incorrect close of socket on windows in SMTP over TLS
"SourceForge.net" <[email protected]> Fri, 13 Nov 2009 09:29:29 +0000
| Newsgroups | gmane.mail.libetpan.user |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #2897095, was opened at 2009-11-13 12:29
Message generated for change (Tracker Item Submitted) made by perminov
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=429696&aid=2897095&group_id=41064
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SMTP
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Sergey Perminov (perminov)
Assigned to: Nobody/Anonymous (nobody)
Summary: Incorrect close of socket on windows in SMTP over TLS
Initial Comment:
Look at src/data-types/mailstream_ssl.c
#ifndef USE_GNUTLS
static void ssl_data_close(struct mailstream_ssl_data * ssl_data)
{
SSL_free(ssl_data->ssl_conn);
ssl_data->ssl_conn = NULL;
SSL_CTX_free(ssl_data->ssl_ctx);
ssl_data->ssl_ctx = NULL;
close(ssl_data->fd);
ssl_data->fd = -1;
}
#else
On Windows close should be replaced with closesocket()
like it's done in src/data-types/mailstream_socket.c
I looked over the code and found some more incorrect closes of TCP socket .
like in
src/data-types/mailstream_ssl.c
src/low-level/imap/mailimap_socket.c
src/low-level/imap/mailimap_ssl.c
src/low-level/nntp/newsnntp_socket.c
src/low-level/nntp/newsnntp_ssl.c
src/low-level/pop3/mailpop3_socket.c
src/low-level/pop3/mailpop3_ssl.c
src/low-level/smtp/mailsmtp_socket.c
On windows this incorrect call of close() on TCP socket leads to runtime error and application termination.
PS:
close() call in src/low-level/smtp/mailsmtp_socket.c is a very rear case but close() in src/data-types/mailstream_ssl.c called on termination of every connection and definitely should be fixed.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=429696&aid=2897095&group_id=41064
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july