#2 mistake in CDavSocket.cpp

open
nobody
None
5
2005-04-20
2005-04-20
yuichi YONEKURA
No

There is a mistake in CDavSocket.cpp:337.

The CDavSocket::connectSSL() method is currently
written the following:

int nResult = SSL_connect(m_pSSL);
if(nResult != 1){
OI_DEBUG("Error connecting via SSL: %s\n",
ERR_reason_error_string(ERR_get_error()));
ERR_clear_error();
cleanupSSL();
cleanupSSLSession();

if(nResult = 0) { <--- Here(line 337)
/*handshake failed*/
return OIEEHANDSHAKEFAILED;
} else if(nResult < 0) {
/*fatal connection error*/
return OIEEFATALCONNERROR;
} else {
/*the impossible happened. openssl's problem*/
return OIEEGENERIC;
/*TODO: try to find where the problem is*/
OI_ASSERT(false);
}

If SSL_Connect() function fails, the method always
returns OIEEGENERIC. To corrent the behavior, It should
be modified the following:

if(nResult == 0) {

Discussion