diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-05-31 10:34:35 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-05-31 22:05:24 +0200 |
commit | 10983c363e4ccd7c82dc01607dbcb611150acfdc (patch) | |
tree | a769be9447f71ab134725f322b2643b34d785df6 /pkg | |
parent | 503ed5fe0319c6a673f3ad43b00aacf2199bcf74 (diff) | |
download | podman-10983c363e4ccd7c82dc01607dbcb611150acfdc.tar.gz podman-10983c363e4ccd7c82dc01607dbcb611150acfdc.tar.bz2 podman-10983c363e4ccd7c82dc01607dbcb611150acfdc.zip |
rootless: make sure the buffer is NUL terminated
after we read from the pause PID file, NUL terminate the buffer to
avoid reading garbage from the stack.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/rootless/rootless_linux.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/rootless/rootless_linux.c b/pkg/rootless/rootless_linux.c index 2356882e7..8608930dd 100644 --- a/pkg/rootless/rootless_linux.c +++ b/pkg/rootless/rootless_linux.c @@ -276,6 +276,8 @@ static void __attribute__((constructor)) init() free (cwd); return; } + buf[r] = '\0'; + pid = strtol (buf, NULL, 10); if (pid == LONG_MAX) { |