Signed-off-by: Michael Santos <michael.san...@gmail.com> --- src/lxc/conf.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/lxc/conf.c b/src/lxc/conf.c index f73eaac..ae5b259 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -205,14 +205,18 @@ static int run_script(const char *name, const char *section, va_start(ap, script); while ((p = va_arg(ap, char *))) - size += strlen(p); + size += strlen(p) + 1; va_end(ap); size += strlen(script); size += strlen(name); size += strlen(section); + size += 3; - buffer = alloca(size + 1); + if (size > INT_MAX) + return -1; + + buffer = alloca(size); if (!buffer) { ERROR("failed to allocate memory"); return -1; -- 1.7.0.4 ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel