Commit 72a30576 by Niklas Eiling

use snprintf instead of strncat

parent a17fa3c0
......@@ -364,10 +364,13 @@ static void exec_criu(struct criu_opts *opts)
buf[0] = 0;
pos = 0;
for (i = 0; argv[i]; i++) {
strncat(buf, argv[i], sizeof(buf) - pos - 1);
strncat(buf, " ", sizeof(buf) - pos - 1);
pos += strlen(argv[i]);
ret = snprintf(buf + pos, sizeof(buf) - pos, "%s ", argv[i]);
if (ret < 0 || ret >= sizeof(buf) - pos)
goto err;
else
pos += ret;
}
INFO("execing: %s", buf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment