From: Aleksandr Mezin Date: Thu, 31 Mar 2016 10:46:03 +0000 (+0600) Subject: Fix buffer overflow in do_start() X-Git-Tag: lxc-2.0.0.rc15~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F934%2Fhead;p=thirdparty%2Flxc.git Fix buffer overflow in do_start() Signed-off-by: Aleksandr Mezin --- diff --git a/src/lxc/start.c b/src/lxc/start.c index 6d2c7b5f5..5be0077bf 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -790,7 +790,7 @@ static int do_start(void *data) } #endif - ret = sprintf(path, "%s/dev/null", handler->conf->rootfs.mount); + ret = snprintf(path, sizeof(path), "%s/dev/null", handler->conf->rootfs.mount); if (ret < 0 || ret >= sizeof(path)) { SYSERROR("sprintf'd too many chars"); goto out_warn_father;