Signed-off-by: Christian Brauner <christianvanbrau...@gmail.com>
---
 src/lxc/lxc_destroy.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/lxc/lxc_destroy.c b/src/lxc/lxc_destroy.c
index 39e289c..0eeff51 100644
--- a/src/lxc/lxc_destroy.c
+++ b/src/lxc/lxc_destroy.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. */
        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);
        if (fd >= 0) {
-- 
2.5.3

_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to