bdev_copy segfaults if bdevtype is NULL

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
S.Çağlar Onur 2013-09-03 16:21:15 -04:00 committed by Serge Hallyn
parent cd0bcc4958
commit e34b5d2ef2

View File

@ -1939,7 +1939,7 @@ struct bdev *bdev_copy(const char *src, const char *oldname, const char *cname,
bdevtype = "overlayfs";
*needs_rdep = 0;
if (strcmp(orig->type, "dir") == 0 &&
if (bdevtype && strcmp(orig->type, "dir") == 0 &&
strcmp(bdevtype, "overlayfs") == 0)
*needs_rdep = 1;