[CRIU] [PATCH] dump: Don't dump file params with on-stack values in dump_task_fs

Cyrill Gorcunov gorcunov at openvz.org
Fri Jun 1 07:11:45 EDT 2012


Ad addition to commit 63000f5bb20e12ced2bc9662482775d163c97c5a,
this place was missed to fix.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-dump.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/cr-dump.c b/cr-dump.c
index c487e60..fecf038 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -552,7 +552,7 @@ err:
 
 static int dump_task_fs(pid_t pid, struct cr_fdset *fdset)
 {
-	struct fd_parms p;
+	struct fd_parms p = { .fd = FD_DESC_INVALID, };
 	struct fs_entry fe;
 	int fd, ret;
 
@@ -565,9 +565,6 @@ static int dump_task_fs(pid_t pid, struct cr_fdset *fdset)
 		return -1;
 	}
 
-	p.flags = 0;
-	p.pos = 0;
-	p.fown = (fown_t){ };
 	fe.cwd_id = fd_id_generate_special();
 
 	ret = dump_one_reg_file(fd, fe.cwd_id, &p);
@@ -585,8 +582,6 @@ static int dump_task_fs(pid_t pid, struct cr_fdset *fdset)
 		return -1;
 	}
 
-	p.flags = 0;
-	p.pos = 0;
 	fe.root_id = fd_id_generate_special();
 
 	ret = dump_one_reg_file(fd, fe.root_id, &p);
-- 
1.7.7.6



More information about the CRIU mailing list