Unverified Commit b1e22e81 by Christian Brauner Committed by Stéphane Graber

lxccontainer: use snprintf()

parent 929d2675
......@@ -2679,7 +2679,11 @@ static struct lxc_container *lxcapi_clone(struct lxc_container *c, const char *n
fclose(fout);
c->lxc_conf->rootfs.path = origroot;
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