From: "Richard W.M. Jones" <rjones@redhat.com>
To: qemu-trivial@nongnu.org
Cc: sw@weilnetz.de, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] ssh: Remove unnecessary use of strlen function.
Date: Thu, 18 Apr 2013 22:09:33 +0100 [thread overview]
Message-ID: <1366319373-12926-1-git-send-email-rjones@redhat.com> (raw)
From: "Richard W.M. Jones" <rjones@redhat.com>
---
block/ssh.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/block/ssh.c b/block/ssh.c
index 8f78e2e..7bc008d 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -387,15 +387,13 @@ static int check_host_key(BDRVSSHState *s, const char *host, int port,
}
/* host_key_check=md5:xx:yy:zz:... */
- if (strlen(host_key_check) >= 4 &&
- strncmp(host_key_check, "md5:", 4) == 0) {
+ if (strncmp(host_key_check, "md5:", 4) == 0) {
return check_host_key_hash(s, &host_key_check[4],
LIBSSH2_HOSTKEY_HASH_MD5, 16);
}
/* host_key_check=sha1:xx:yy:zz:... */
- if (strlen(host_key_check) >= 5 &&
- strncmp(host_key_check, "sha1:", 5) == 0) {
+ if (strncmp(host_key_check, "sha1:", 5) == 0) {
return check_host_key_hash(s, &host_key_check[5],
LIBSSH2_HOSTKEY_HASH_SHA1, 20);
}
--
1.8.1.4
next reply other threads:[~2013-04-18 21:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-18 21:09 Richard W.M. Jones [this message]
2013-04-18 21:24 ` [Qemu-devel] [PATCH] ssh: Remove unnecessary use of strlen function Eric Blake
2013-04-19 4:07 ` Stefan Weil
2013-04-19 9:45 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1366319373-12926-1-git-send-email-rjones@redhat.com \
--to=rjones@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=sw@weilnetz.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).