X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=super0.c;h=07f47924eae0bbbe15be9ef5a09ea5b518c7a980;hb=40d28f0d1bf28bc706b734932f46a9190b9fec5b;hp=3f02ed403435bcaf4c5196e931539627c7ba8495;hpb=8320878543bb5e49b5acb24fa919ff11be485c61;p=thirdparty%2Fmdadm.git diff --git a/super0.c b/super0.c index 3f02ed40..07f47924 100644 --- a/super0.c +++ b/super0.c @@ -1,7 +1,7 @@ /* * mdadm - manage Linux "md" devices aka RAID arrays. * - * Copyright (C) 2001-2006 Neil Brown + * Copyright (C) 2001-2009 Neil Brown * * * This program is free software; you can redistribute it and/or modify @@ -19,12 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Neil Brown - * Email: - * Paper: Neil Brown - * School of Computer Science and Engineering - * The University of New South Wales - * Sydney, 2052 - * Australia + * Email: */ #define HAVE_STDINT_H 1 @@ -310,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); }