From: S.Çağlar Onur Date: Tue, 3 Sep 2013 20:21:15 +0000 (-0400) Subject: bdev_copy segfaults if bdevtype is NULL X-Git-Tag: lxc-1.0.0.alpha1~1^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e34b5d2ef2c329afe6540bbfc298ae631378832e;p=thirdparty%2Flxc.git bdev_copy segfaults if bdevtype is NULL Signed-off-by: S.Çağlar Onur Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c index 39592b2b3..b45f2cb06 100644 --- a/src/lxc/bdev.c +++ b/src/lxc/bdev.c @@ -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;