summaryrefslogtreecommitdiff
path: root/ssh-vulnkey.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2008-05-26 01:12:43 +0000
committerColin Watson <cjwatson@debian.org>2008-05-26 01:12:43 +0000
commit1366313979ce785614d6a52348f61edc20d870b2 (patch)
tree28e3f750a854ab97c982b6f473b9e2f01fe2831c /ssh-vulnkey.c
parent7674bfd31baf7e045e289dc91f4cb49972f24fe1 (diff)
Handle leading IP addresses in ssh-vulnkey input (LP: #230497).
Diffstat (limited to 'ssh-vulnkey.c')
-rw-r--r--ssh-vulnkey.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ssh-vulnkey.c b/ssh-vulnkey.c
index 3ffc3fa0c..467bef091 100644
--- a/ssh-vulnkey.c
+++ b/ssh-vulnkey.c
@@ -163,6 +163,7 @@ do_filename(const char *filename, int quiet_open)
163 int i; 163 int i;
164 char *space; 164 char *space;
165 int type; 165 int type;
166 char *end;
166 167
167 /* Chop trailing newline. */ 168 /* Chop trailing newline. */
168 i = strlen(line) - 1; 169 i = strlen(line) - 1;
@@ -187,7 +188,8 @@ do_filename(const char *filename, int quiet_open)
187 /* Leading number (RSA1) or valid type (RSA/DSA) indicates 188 /* Leading number (RSA1) or valid type (RSA/DSA) indicates
188 * that we have no host name or options to skip. 189 * that we have no host name or options to skip.
189 */ 190 */
190 if (atoi(cp) == 0 && type == KEY_UNSPEC) { 191 if ((strtol(cp, &end, 10) == 0 || *end != ' ') &&
192 type == KEY_UNSPEC) {
191 int quoted = 0; 193 int quoted = 0;
192 194
193 for (; *cp && (quoted || (*cp != ' ' && *cp != '\t')); cp++) { 195 for (; *cp && (quoted || (*cp != ' ' && *cp != '\t')); cp++) {