]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fix buffer overflow in do_start() 934/head
authorAleksandr Mezin <mezin.alexander@gmail.com>
Thu, 31 Mar 2016 10:46:03 +0000 (16:46 +0600)
committerAleksandr Mezin <mezin.alexander@gmail.com>
Thu, 31 Mar 2016 10:46:03 +0000 (16:46 +0600)
Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
src/lxc/start.c

index 6d2c7b5f5494171ccdc5e6fac4efb88f5487512e..5be0077bf46d26a9c9b67ded7a8a9b8dffd2da88 100644 (file)
@@ -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;