lxccontainer: use snprintf()

parent 5e78e16a
......@@ -3354,7 +3354,11 @@ static struct lxc_container *do_lxcapi_clone(struct lxc_container *c, const char
saved_unexp_conf = NULL;
c->lxc_conf->unexpanded_len = saved_unexp_len;
sprintf(newpath, "%s/%s/rootfs", lxcpath, newname);
ret = snprintf(newpath, MAXPATHLEN, "%s/%s/rootfs", lxcpath, newname);
if (ret < 0 || ret >= MAXPATHLEN) {
SYSERROR("clone: failed making rootfs pathname");
goto out;
}
if (mkdir(newpath, 0755) < 0) {
SYSERROR("error creating %s", newpath);
goto out;
......
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