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

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

From: Alexander Lamaison <swish_at_lammy.co.uk>
Date: Sat, 8 Jun 2013 00:41:52 +0100

Replying again in case my mobile message didn't make it:

If I'm reading the error message right, a null session pointer is passed to
_last_errno. So the error is occurring at a layer above libssh2. In curl
maybe?

Alex

On 7 June 2013 15:56, balloon <e_balloon_at_163.com> wrote:

> hi,
> 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);
> curl_easy_perform(curl);
> curl_easy_cleanup(curl);
>
> 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.
>
>
>
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>
>

-- 
Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org)

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2013-06-08