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:
committed by
Lennart Poettering
parent
739d638a6e
commit
daf535a382
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user