Subject: Segmentation fault libssh2_session_last_errno (session=0x0) at session.c:1219

Segmentation fault libssh2_session_last_errno (session=0x0) at session.c:1219

From: balloon <>
Date: Fri, 7 Jun 2013 22:56:16 +0800 (CST)

I'm using: libcurl (7.21.3) + openssl(0.9.8k) + libssh2(1.2.8) as SFTP client to try to download 1 byte from server . Client side code is like this:

        CURL *curl = curl_easy_init();
        curl_easy_setopt(curl, CURLOPT_SSH_AUTH_TYPES, CURLSSH_AUTH_PASSWORD);
        curl_easy_setopt(curl, CURLOPT_USERPWD, m_userpwd.c_str());
        curl_easy_setopt(curl, CURLOPT_URL, myUrl.c_str());
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, hd_src);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, this->write_callback);
 curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)1);

To most SFTP server, this works fine. But when we use this code to connect to the SFTP server that our customer provided.
We get this error in step curl_easy_perform(curl) :

But if we try to connect customer's SFTP server by FileZilla or other mature SFTP client, no error occur.
This seems to be really serious issue, and I don't know what is wrong here. Please do help to figure it out. Thanks.


Received on 2013-06-07