[CRIU] [PATCH 1/3] net: Use snprintf instead of sprintf

Cyrill Gorcunov gorcunov at openvz.org
Wed Apr 29 12:51:11 PDT 2015


Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net.c b/net.c
index 68034d47698f..5f378d496276 100644
--- a/net.c
+++ b/net.c
@@ -101,7 +101,7 @@ static int ipv4_conf_op(char *tgt, int *conf, int op, NetnsEntry **netns)
 			continue;
 		}
 
-		sprintf(path[i], "%s/%s/%s", NET_CONF_PATH, tgt, devconfs[i]);
+		snprintf(path[i], MAX_CONF_OPT_PATH, "%s/%s/%s", NET_CONF_PATH, tgt, devconfs[i]);
 		req[ri].name = path[i];
 		req[ri].arg = &conf[i];
 		req[ri].type = CTL_32;
-- 
2.1.0



More information about the CRIU mailing list