Commit 2735dfae by Tycho Andersen

c/r: fix off-by-one error

When we read sizeof(buf) bytes here, we'd write off the end of the array, which is bad :) Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
parent 9f1f54b0
......@@ -883,6 +883,8 @@ static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_
goto out_fini_handler;
}
if (n == sizeof(buf))
n--;
buf[n] = 0;
ERROR("criu process exited %d, output:\n%s", WEXITSTATUS(status), buf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment