Commit 2e8b4ddb by Serge Hallyn Committed by Stéphane Graber

lxcapi_snapshot: check that c is defined

before using it, like the other snapshot api methods do. This will need to go into stable-1.0 as well. Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent d63b7ba4
......@@ -2859,6 +2859,9 @@ static int lxcapi_snapshot(struct lxc_container *c, const char *commentfile)
struct lxc_container *c2;
char snappath[MAXPATHLEN], newname[20];
if (!c || !lxcapi_is_defined(c))
return -1;
// /var/lib/lxc -> /var/lib/lxcsnaps \0
ret = snprintf(snappath, MAXPATHLEN, "%ssnaps/%s", c->config_path, c->name);
if (ret < 0 || ret >= MAXPATHLEN)
......
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