]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/coredump/coredump.c
coredump: do not try to access unitialized CONTEXT_COMM field
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 25 Feb 2017 19:00:39 +0000 (14:00 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 27 Feb 2017 00:45:07 +0000 (19:45 -0500)
commitea5cc2a8f65535a9b3f8ba39a8df13a0c770f41d
treed1944bd6ac10dcb5a55da5ac997de5c3eeb5c241
parenta6a73a10e813d8ced0b4ae0da4d2b3fe9f00120b
coredump: do not try to access unitialized CONTEXT_COMM field

Most of the fields in the context array come from the kernel (passed
through argv), but two are special: comm and exe. We allocate them
ourselves. We forgot to initialize context[CONTEXT_COMM] with the value
we allocated (introduced in 9aa820231414baa28e6bf02a033932cb69ff6b8b).
To simplify things, just set context[CONTEXT_COMM] and context[CONTEXT_EXE],
and free those two fields at the end.

Fixes #5442.
src/coredump/coredump.c