cURL / Mailing Lists / curl-library / Single Mail

curl-library

Crash when re-using an scp conn when auth failed the previous time (r 7.19.6)

From: Liza Alenchery <lalenchery_at_acmepacket.com>
Date: Fri, 16 Oct 2009 14:49:33 -0400

Trying posting this again.

Hi

I apologize if this is something that has already been reported, but I was unable to find a mention about it.

For SCP, when authentication fails (maybe due to a wrong password), and then the same request is made, there is an attempt to re-use the connection and then it crashes.

I was trying 7.19.6, libssh2 1.2

Seems to me this is because:

1) On auth failure, sshc->ssh_session is set to NULL in ssh_statemach_act(), case SSH_SESSION_FREE

2) data->state.conn is not cleaned up.

3) In the next request, this connection is reused. sshc->ssh_session is NULL, but is sent in a call to libssh2_scp_send_ex(), causing the crash.

I was able to make the crash go away, by setting conn->bits.close = TRUE after sshc->ssh_session is set to NULL, so that this connection is not re-used the next time. Or I can reset data->state.conn.

I am using the multi interface.

Do let me know if this is an actual bug or if there is some other way I should be calling the APIs.

Liza

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-10-16