Skip to content

Commit

Permalink
Correctly parse OBJECT_PID in journald messages (systemd#3129)
Browse files Browse the repository at this point in the history
The parse_pid() function doesn't succeed if we don't zero-terminate after the
last digit in the buffer.
  • Loading branch information
nalind authored and poettering committed Apr 27, 2016
1 parent 739d638 commit daf535a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/journal/journald-native.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit daf535a

Please sign in to comment.