1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-08 19:02:06 +03:00

pki: Fix random memory corruption

Fixes T78

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-06-29 09:22:26 +02:00
parent aa95eb1965
commit 1444ae5add
3 changed files with 23 additions and 4 deletions

View File

@@ -1084,7 +1084,7 @@ int ssh_pki_import_pubkey_file(const char *filename, ssh_key *pkey)
key_buf[size] = '\0';
q = p = key_buf;
while (!isspace((int)*p)) p++;
while (*p != '\0' && !isspace((int)*p)) p++;
*p = '\0';
type = ssh_key_type_from_name(q);
@@ -1093,7 +1093,7 @@ int ssh_pki_import_pubkey_file(const char *filename, ssh_key *pkey)
return SSH_ERROR;
}
q = ++p;
while (!isspace((int)*p)) p++;
while (*p != '\0' && !isspace((int)*p)) p++;
*p = '\0';
rc = ssh_pki_import_pubkey_base64(q, type, pkey);