summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--super0.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/super0.c b/super0.c
index 2b4942f4..07f47924 100644
--- a/super0.c
+++ b/super0.c
@@ -305,9 +305,13 @@ static int match_home0(struct supertype *st, char *homehost)
{
mdp_super_t *sb = st->sb;
char buf[20];
- char *hash = sha1_buffer(homehost,
- strlen(homehost),
- buf);
+ char *hash;
+
+ if (!homehost)
+ return 0;
+ hash = sha1_buffer(homehost,
+ strlen(homehost),
+ buf);
return (memcmp(&sb->set_uuid2, hash, 8)==0);
}