cURL / Mailing Lists / curl-library / Single Mail


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

From: Daniel Stenberg <>
Date: Thu, 22 Oct 2009 09:12:16 +0200 (CEST)

On Fri, 16 Oct 2009, Liza Alenchery wrote:

> 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.

Thanks for the report. I tried some simple command lines to repeat this
problem but failed. Can you provide a simple way to repeat it? It'd be nice to
add as a test case for this if nothing else.

> 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 think we should probably close the connection after the SESSION_FREE state.
Re-use of connections are generally done within libcurl only with successful
logins (for those protocols that offer such a concept) so a failed login or
even a session that has ended should then render a connection that can't be

So I think the "conn->bits.close = TRUE" fix is the one I'll vote for here.

List admin:
Received on 2009-10-22