summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-12-04 09:00:34 +0100
committerDaniel Stenberg <daniel@haxx.se>2017-12-04 09:00:34 +0100
commita9a4fc8ba71bb05991a30b23eae2a65467d5bffe (patch)
tree7d0b01ab5cde74c36efe9e2c0b62e0d4eb292898
parenta08f5a77ccf728740a5fccd9bd1098dea066176d (diff)
downloadcurl-bagder/libssh2-dead-code.tar.gz
libssh2: remove dead code from SSH_SFTP_QUOTEbagder/libssh2-dead-code
Figured out while reviwring 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
-rw-r--r--lib/ssh.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ssh.c b/lib/ssh.c
index ef169ade7..a4dd878bf 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -1142,6 +1142,9 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
/*
* 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;
sshc->acceptfail = FALSE;
@@ -1184,7 +1187,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
state(conn, SSH_SFTP_NEXT_QUOTE);
break;
}
- if(cmd) {
+ {
/*
* the arguments following the command must be separated from the
* 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;
}
}
- if(!sshc->quote_item) {
- state(conn, SSH_SFTP_GETINFO);
- }
break;
case SSH_SFTP_NEXT_QUOTE: