From 57487085dc577205757739161c3eeca4f9feefb3 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Thu, 11 Aug 2016 14:02:48 +0100 Subject: [PATCH] lxc: don't try to reference NULL when mounting filesystems would lead to lxcContainerMountAllFS calling STRPREFIX on a NLL pointer because it failed to check if fs->src->path was non-NULL. This is a regression caused by commit da665fbd4858890fbb3bbf5da2a7b6ca37bb3220 Author: Olga Krishtal Date: Thu Jul 14 16:52:38 2016 +0300 filesystem: adds possibility to use storage pool as fs source Signed-off-by: Olga Krishtal Signed-off-by: Daniel P. Berrange --- src/lxc/lxc_container.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index e1eb434c06..5357df48de 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -1627,8 +1627,7 @@ static int lxcContainerMountAllFS(virDomainDefPtr vmDef, if (lxcContainerResolveSymlinks(vmDef->fss[i], false) < 0) return -1; - - if (!(vmDef->fss[i]->src && + if (!(vmDef->fss[i]->src && vmDef->fss[i]->src->path && STRPREFIX(vmDef->fss[i]->src->path, vmDef->fss[i]->dst)) && lxcContainerUnmountSubtree(vmDef->fss[i]->dst, false) < 0) return -1;