[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 16/125: libssh: fix minor static code analyzer nits
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 16/125: libssh: fix minor static code analyzer nits |
Date: |
Sun, 21 Jan 2018 23:41:11 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 3cef6f22eae7b7e60c19689d0f07492c700a8e0f
Author: Daniel Stenberg <address@hidden>
AuthorDate: Sat Dec 2 23:27:22 2017 +0100
libssh: fix minor static code analyzer nits
- remove superfluous NULL check which otherwise tricks the static code
analyzers to assume NULL pointer dereferences.
- fix fallthrough in switch()
- indent mistake
---
lib/ssh-libssh.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/lib/ssh-libssh.c b/lib/ssh-libssh.c
index 732aad7fa..8856d9044 100644
--- a/lib/ssh-libssh.c
+++ b/lib/ssh-libssh.c
@@ -325,8 +325,8 @@ static int myssh_is_known(struct connectdata *conn)
if(hlen != strlen(data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5]) ||
memcmp(&data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5], hash, hlen)) {
- rc = SSH_ERROR;
- goto cleanup;
+ rc = SSH_ERROR;
+ goto cleanup;
}
rc = SSH_OK;
@@ -342,11 +342,15 @@ static int myssh_is_known(struct connectdata *conn)
switch(vstate) {
case SSH_SERVER_KNOWN_OK:
keymatch = CURLKHMATCH_OK;
+ break;
case SSH_SERVER_FILE_NOT_FOUND:
+ /* fallthrough */
case SSH_SERVER_NOT_KNOWN:
keymatch = CURLKHMATCH_MISSING;
- default:
+ break;
+ default:
keymatch = CURLKHMATCH_MISMATCH;
+ break;
}
if(func) { /* use callback to determine action */
@@ -994,8 +998,8 @@ static CURLcode myssh_statemach_act(struct connectdata
*conn, bool *block)
if(statvfs != 0 && !sshc->acceptfail) {
Curl_safefree(sshc->quote_path1);
err = sftp_get_error(sshc->sftp_session);
- failf(data, "statvfs command failed: %s",
- ssh_get_error(sshc->ssh_session));
+ failf(data, "statvfs command failed: %s (%d)",
+ ssh_get_error(sshc->ssh_session), err);
state(conn, SSH_SFTP_CLOSE);
sshc->nextstate = SSH_NO_STATE;
sshc->actualcode = CURLE_QUOTE_ERROR;
@@ -1620,8 +1624,7 @@ static CURLcode myssh_statemach_act(struct connectdata
*conn, bool *block)
sftp_close(sshc->sftp_file);
sshc->sftp_file = NULL;
}
- if(protop)
- Curl_safefree(protop->path);
+ Curl_safefree(protop->path);
DEBUGF(infof(data, "SFTP DONE done\n"));
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] branch master updated (851483824 -> cc5f34a99), gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 04/125: lib: don't export all symbols, just everything curl_*, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 10/125: .travis.yml: added build --with-libssh, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 11/125: symbols-in-versions: added new symbols with 7.56.3 version, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 02/125: examples/xmlstream.c: don't switch off CURL_GLOBAL_SSL, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 01/125: travis: add boringssl build, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 09/125: libssh2: return CURLE_UPLOAD_FAILED on failure to upload, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 05/125: curlver: towards 7.57.1, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 06/125: RELEASE-NOTES: synced with af8cc7a69, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 13/125: lib582: do not verify host for SFTP, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 16/125: libssh: fix minor static code analyzer nits,
gnunet <=
- [GNUnet-SVN] [gnurl] 18/125: libssh: corrected use of sftp_statvfs() in SSH_SFTP_QUOTE_STATVFS, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 14/125: travis: use pip2 instead of pip, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 15/125: openssl: pkcs12 is supported by boringssl, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 19/125: RESOURCES: update spec names, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 21/125: ssh-libssh.c: please checksrc, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 22/125: libssh2: remove dead code from SSH_SFTP_QUOTE, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 08/125: libssh2: send the correct CURLE error code on scp file not found, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 03/125: SSL: Avoid magic allocation of SSL backend specific data, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 32/125: URL: tolerate backslash after drive letter for FILE:, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 17/125: libssh: no need to call sftp_get_error as ssh_get_error is sufficient, gnunet, 2018/01/21