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