[CRIU] [PATCH] mem: don't use an unitialized pointer

Andrey Vagin avagin at openvz.org
Thu Nov 27 23:59:44 PST 2014


When we are dumping pages on pre-dump, we know nothing about a parent
images, so we need to splice all memory to pipes and then decide which
should be dumped.

CID 83244 (#1 of 1): Uninitialized pointer read (UNINIT)
14. uninit_use: Using uninitialized value xfer.parent.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mem.c b/mem.c
index 9aedf37..478e85e 100644
--- a/mem.c
+++ b/mem.c
@@ -244,7 +244,7 @@ static int __parasite_dump_pages_seized(struct parasite_ctl *ctl,
 	pmc_t pmc = PMC_INIT;
 	struct page_pipe *pp;
 	struct vma_area *vma_area;
-	struct page_xfer xfer;
+	struct page_xfer xfer = { .parent = NULL };
 	int ret = -1;
 
 	pr_info("\n");
-- 
1.9.3



More information about the CRIU mailing list