]> git.proxmox.com Git - mirror_lxc.git/commit
Ensure that mmap()ed memory is \0-terminated (v3)
authorChristian Brauner <christianvanbrauner@gmail.com>
Fri, 11 Sep 2015 06:07:37 +0000 (08:07 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 21 Sep 2015 15:41:43 +0000 (11:41 -0400)
commit42342bed255ed2cb72e371e1890c264f04201042
tree2169f7ea6a5b82a4b554cb69eed1b9b1f3a56a5a
parentaf651aa9e1ae642a586884b7875df60351be2c75
Ensure that mmap()ed memory is \0-terminated (v3)

Use pwrite() to write terminating \0-byte

This allows us to use standard string handling functions and we can avoid using
the GNU-extension memmem(). This simplifies removing the container from the
lxc_snapshots file. Wrap strstr() in a while loop to remove duplicate entries.

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxccontainer.c