From: Nalin Dahyabhai Date: Wed, 27 Apr 2016 08:32:05 +0000 (-0400) Subject: Correctly parse OBJECT_PID in journald messages (#3129) X-Git-Tag: v230~123 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=daf535a3829121155683e63e729093347b691a3e;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c index 3d8f05996b5..a445291a5e3 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);