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.
This commit is contained in:
Nalin Dahyabhai
2016-04-27 10:32:05 +02:00
committed by Lennart Poettering
parent 739d638a6e
commit daf535a382
+1 -1
View File
@@ -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);