1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

libssh2: remove dead code from SSH_SFTP_QUOTE

Figured out while reviewing code in the libssh backend. The pointer was
checked for NULL after having been dereferenced, so we know it would
always equal true or it would've crashed.

Pointed-out-by: Nikos Mavrogiannopoulos

Bug #2143
Closes #2148
This commit is contained in:
Daniel Stenberg 2017-12-04 09:00:34 +01:00
parent 6401ddad44
commit 4401409468
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -1142,6 +1142,9 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
/* /*
* Support some of the "FTP" commands * Support some of the "FTP" commands
*
* 'sshc->quote_item' is already verified to be non-NULL before it
* switched to this state.
*/ */
char *cmd = sshc->quote_item->data; char *cmd = sshc->quote_item->data;
sshc->acceptfail = FALSE; sshc->acceptfail = FALSE;
@ -1184,7 +1187,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
state(conn, SSH_SFTP_NEXT_QUOTE); state(conn, SSH_SFTP_NEXT_QUOTE);
break; break;
} }
if(cmd) { {
/* /*
* the arguments following the command must be separated from the * the arguments following the command must be separated from the
* command with a space so we can check for it unconditionally * command with a space so we can check for it unconditionally
@ -1314,9 +1317,6 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
break; break;
} }
} }
if(!sshc->quote_item) {
state(conn, SSH_SFTP_GETINFO);
}
break; break;
case SSH_SFTP_NEXT_QUOTE: case SSH_SFTP_NEXT_QUOTE: