cURL / Mailing Lists / curl-library / Single Mail


RE: curl lib sftp crashing

From: Joe Mason <>
Date: Tue, 31 Jul 2012 14:26:35 +0000

> From: [] on behalf of madhusudana yn []
> #0 0xf7ed105f in libssh2_session_last_errno (session=0x0) at session.c:1252
> #1 0xf7eae017 in ssh_statemach_act (conn=0xbaba25c, block=0xe921817b) at ssh.c:1456

The line numbers in my copy of curl are different, but I think that's this block of code, right?

      sshc->sftp_handle =
        libssh2_sftp_open_ex(sshc->sftp_session, sftp_scp->path,
                             flags, data->set.new_file_perms,

      if(!sshc->sftp_handle) {
        rc = libssh2_session_last_errno(sshc->ssh_session);

So I suspect that should be "libssh2_session_last_errno(sshc->sftp_session)", since sftp_session is what's used in the libssh2_sftp_open_ex call. That's just a guess, though - I don't really know the difference between ssh_session and sftp_session.

Most uses of libssh2_session_last_errno look like this:

      sshc->authlist = libssh2_userauth_list(sshc->ssh_session,

      if(!sshc->authlist) {
        if((err = libssh2_session_last_errno(sshc->ssh_session)) ==

With the libssh2 call right before the libssh2_session_last_errno call both using ssh_session. But there are three or four which have a libssh2 call using sftp_session followed by libssh2_session_last_errno taking ssh_session. Do all of those calls need to be fixed?

This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

List admin:
Received on 2012-07-31