]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Correctly parse OBJECT_PID in journald messages (#3129)
authorNalin Dahyabhai <nalin@redhat.com>
Wed, 27 Apr 2016 08:32:05 +0000 (04:32 -0400)
committerLennart Poettering <lennart@poettering.net>
Wed, 27 Apr 2016 08:32:05 +0000 (10:32 +0200)
The parse_pid() function doesn't succeed if we don't zero-terminate after the
last digit in the buffer.

src/journal/journald-native.c

index 3d8f05996b5280ea53bf4fae5de947a0f2d78bb4..a445291a5e397f849282500cac86d6d494c88a13 100644 (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);