summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2016-04-27 04:32:05 -0400
committerLennart Poettering <lennart@poettering.net>2016-04-27 10:32:05 +0200
commitdaf535a3829121155683e63e729093347b691a3e (patch)
tree3e95990022b6e1f91fca10fe3920bdba1e549ba6
parent739d638a6e4f214217f60708911db6028a87a48c (diff)
Correctly parse OBJECT_PID in journald messages (#3129)
The parse_pid() function doesn't succeed if we don't zero-terminate after the last digit in the buffer.
-rw-r--r--src/journal/journald-native.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c
index 3d8f05996b..a445291a5e 100644
--- a/src/journal/journald-native.c
+++ b/src/journal/journald-native.c
@@ -206,7 +206,7 @@ void server_process_native_message(
allow_object_pid(ucred)) {
char buf[DECIMAL_STR_MAX(pid_t)];
memcpy(buf, p + strlen("OBJECT_PID="), l - strlen("OBJECT_PID="));
- char_array_0(buf);
+ buf[l-strlen("OBJECT_PID=")] = '\0';
/* ignore error */
parse_pid(buf, &object_pid);