Commit 793e387a by Christian Brauner Committed by Stéphane Graber

Check return value of snprintf

parent 4963978b
...@@ -152,6 +152,8 @@ static int do_destroy_with_snapshots(struct lxc_container *c) ...@@ -152,6 +152,8 @@ static int do_destroy_with_snapshots(struct lxc_container *c)
/* Destroy snapshots created with lxc-clone listed in lxc-snapshots. */ /* Destroy snapshots created with lxc-clone listed in lxc-snapshots. */
ret = snprintf(path, MAXPATHLEN, "%s/%s/lxc_snapshots", c->config_path, c->name); ret = snprintf(path, MAXPATHLEN, "%s/%s/lxc_snapshots", c->config_path, c->name);
if (ret < 0 || ret >= MAXPATHLEN)
return -1;
fd = open(path, O_RDONLY | O_CLOEXEC); fd = open(path, O_RDONLY | O_CLOEXEC);
if (fd >= 0) { if (fd >= 0) {
......
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