projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
739d638
)
Correctly parse OBJECT_PID in journald messages (#3129)
author
Nalin Dahyabhai
<nalin@redhat.com>
Wed, 27 Apr 2016 08:32:05 +0000
(
04:32
-0400)
committer
Lennart 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
patch
|
blob
|
history
diff --git
a/src/journal/journald-native.c
b/src/journal/journald-native.c
index 3d8f05996b5280ea53bf4fae5de947a0f2d78bb4..a445291a5e397f849282500cac86d6d494c88a13 100644
(file)
--- 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);