aboutsummaryrefslogtreecommitdiff
path: root/src/knownhosts.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/knownhosts.c')
-rw-r--r--src/knownhosts.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/knownhosts.c b/src/knownhosts.c
index 7563d273..f9aa1588 100644
--- a/src/knownhosts.c
+++ b/src/knownhosts.c
@@ -403,10 +403,12 @@ int ssh_known_hosts_parse_line(const char *hostname,
p = strtok(NULL, " ");
if (p != NULL) {
p = strstr(line, p);
- e->comment = strdup(p);
- if (e->comment == NULL) {
- rc = SSH_ERROR;
- goto out;
+ if (p != NULL) {
+ e->comment = strdup(p);
+ if (e->comment == NULL) {
+ rc = SSH_ERROR;
+ goto out;
+ }
}
}