[CRIU] [PATCH 02/18] plugin: don't declare two different variables with the same name

Andrei Vagin avagin at openvz.org
Thu Nov 9 22:20:56 MSK 2017


From: Andrei Vagin <avagin at virtuozzo.com>

CID 73359 (#1 of 1): Use of untrusted string value (TAINTED_STRING)
22. tainted_string: Passing tainted string path to cr_lib_load, which cannot accept tainted data.

Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 criu/plugin.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/criu/plugin.c b/criu/plugin.c
index 6d9511857..72a8b2c07 100644
--- a/criu/plugin.c
+++ b/criu/plugin.c
@@ -192,7 +192,6 @@ void cr_plugin_fini(int stage, int ret)
 int cr_plugin_init(int stage)
 {
 	int exit_code = -1;
-	char *path;
 	size_t i;
 	DIR *d;
 
@@ -201,6 +200,8 @@ int cr_plugin_init(int stage)
 		INIT_LIST_HEAD(&cr_plugin_ctl.hook_chain[i]);
 
 	if (opts.libdir == NULL) {
+		char *path;
+
 		path = getenv("CRIU_LIBS_DIR");
 		if (path)
 			opts.libdir = path;
-- 
2.13.6



More information about the CRIU mailing list