[lxc-devel] [PATCH 2/3] coverity: fix dereference NULL return value
Dwight Engen
dwight.engen at oracle.com
Fri May 3 20:50:32 UTC 2013
also break once we have found root, no need to search the rest of the mounts
Signed-off-by: Dwight Engen <dwight.engen at oracle.com>
---
src/lxc/conf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 125e8a6..827626f 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -1067,10 +1067,11 @@ int detect_shared_rootfs(void)
if (strcmp(p+1, "/") == 0) {
// this is '/'. is it shared?
p = index(p2+1, ' ');
- if (strstr(p, "shared:")) {
+ if (p && strstr(p, "shared:")) {
fclose(f);
return 1;
}
+ break;
}
}
fclose(f);
--
1.8.1.4
More information about the lxc-devel
mailing list