mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +09:00
pki: Make sure the key_buf is null terminated.
Found by Coverity.
This commit is contained in:
@@ -838,6 +838,7 @@ int ssh_pki_import_pubkey_file(const char *filename, ssh_key *pkey)
|
|||||||
filename, strerror(errno));
|
filename, strerror(errno));
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
key_buf[size] = '\0';
|
||||||
|
|
||||||
q = p = key_buf;
|
q = p = key_buf;
|
||||||
while (!isspace((int)*p)) p++;
|
while (!isspace((int)*p)) p++;
|
||||||
|
|||||||
Reference in New Issue
Block a user