]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc_monitor: make sure msg.name is null terminated (bug found by coverity)
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 15 Apr 2013 02:39:34 +0000 (21:39 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 15 Apr 2013 02:39:34 +0000 (21:39 -0500)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc_monitor.c

index 0530373906fbeb539ec3724605c3f5b441430bd0..8c158698e3f2bf8072619980a26372e83ad618e1 100644 (file)
@@ -97,6 +97,7 @@ int main(int argc, char *argv[])
                if (lxc_monitor_read(fd, &msg) < 0)
                        return -1;
 
+               msg.name[sizeof(msg.name)-1] = '\0';
                if (regexec(&preg, msg.name, 0, NULL, 0))
                        continue;