mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 02:38:09 +09:00
knownhosts: Fix possible null pointer dereference
CID 1391447 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -403,12 +403,14 @@ int ssh_known_hosts_parse_line(const char *hostname,
|
||||
p = strtok(NULL, " ");
|
||||
if (p != NULL) {
|
||||
p = strstr(line, p);
|
||||
if (p != NULL) {
|
||||
e->comment = strdup(p);
|
||||
if (e->comment == NULL) {
|
||||
rc = SSH_ERROR;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*entry = e;
|
||||
SAFE_FREE(known_host);
|
||||
|
||||
Reference in New Issue
Block a user