The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/2403

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Out-of-bounds write

Signed-off-by: 2xsec <[email protected]>
From 40229e9533ad85e399ff4c44448020d99cc4abae Mon Sep 17 00:00:00 2001
From: 2xsec <[email protected]>
Date: Fri, 15 Jun 2018 00:19:22 +0900
Subject: [PATCH] coverity: #1425778

Out-of-bounds write

Signed-off-by: 2xsec <[email protected]>
---
 src/lxc/criu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/lxc/criu.c b/src/lxc/criu.c
index 1ff4caef8..eab650d7e 100644
--- a/src/lxc/criu.c
+++ b/src/lxc/criu.c
@@ -1314,7 +1314,11 @@ static bool do_dump(struct lxc_container *c, char *mode, 
struct migrate_opts *op
                        SYSERROR("read");
                        n = 0;
                }
-               buf[n] = 0;
+
+               if (n == sizeof(buf))
+                       buf[n-1] = 0;
+               else
+                       buf[n] = 0;
 
                if (WIFEXITED(status)) {
                        if (WEXITSTATUS(status)) {
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to