From 92ee6447b1deef7c79962a8121fdf8e58acb3a83 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Fri, 26 Dec 2014 09:02:01 -0500 Subject: journald: always allocate space for object fields If OBJECT_PID= came as the last field, we would not reallocate the iovec to bigger size, and fail the assertion later on in dispatch_message_real(). --- src/journal/journald-native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/journal') diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c index e994752558..b0120ef5f8 100644 --- a/src/journal/journald-native.c +++ b/src/journal/journald-native.c @@ -135,7 +135,7 @@ void server_process_native_message( /* A property follows */ /* n existing properties, 1 new, +1 for _TRANSPORT */ - if (!GREEDY_REALLOC(iovec, m, n + 2 + N_IOVEC_META_FIELDS + !!object_pid * N_IOVEC_OBJECT_FIELDS)) { + if (!GREEDY_REALLOC(iovec, m, n + 2 + N_IOVEC_META_FIELDS + N_IOVEC_OBJECT_FIELDS)) { log_oom(); break; } -- cgit v1.2.3-54-g00ecf