[lxc-devel] [PATCH] bdev_copy segfaults if bdevtype is NULL

S.Çağlar Onur caglar at 10ur.org
Tue Sep 3 20:21:15 UTC 2013


Signed-off-by: S.Çağlar Onur <caglar at 10ur.org>
---
 src/lxc/bdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c
index 39592b2..b45f2cb 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;
 
-- 
1.8.1.2





More information about the lxc-devel mailing list