Signed-off-by: Christian Seiler <christ...@iwakd.de>
---
 src/lxc/apparmor.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lxc/apparmor.c b/src/lxc/apparmor.c
index a2d6476..cb81464 100644
--- a/src/lxc/apparmor.c
+++ b/src/lxc/apparmor.c
@@ -42,12 +42,13 @@ again:
        }
        sz += 1024;
        buf = realloc(buf, sz);
+       memset(buf, 0, sz);
        if (!buf) {
                ERROR("out of memory");
                fclose(f);
                return NULL;
        }
-       ret = fread(buf, 1, sz, f);
+       ret = fread(buf, 1, sz - 1, f);
        fclose(f);
        if (ret >= sz)
                goto again;
-- 
1.7.10.4


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to