From: noxiouz Date: Mon, 6 Apr 2026 10:22:58 +0000 (+0100) Subject: journald-native: fix field-count limit off-by-one X-Git-Tag: v261-rc1~578 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e76281b2f4ca93fcb00fd08ba1a7584c087fe5d;p=thirdparty%2Fsystemd.git journald-native: fix field-count limit off-by-one Reject entries once the configured maximum field count is reached. The previous check used n > ENTRY_FIELD_COUNT_MAX before appending a new field, which let one extra field through in boundary cases. Switch the check to n >= ENTRY_FIELD_COUNT_MAX so an entry at the limit is rejected before adding another property. Co-developed-by: Codex (GPT-5) --- diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c index 1e2a872c6ed..fade424ebcd 100644 --- a/src/journal/journald-native.c +++ b/src/journal/journald-native.c @@ -146,7 +146,7 @@ static int manager_process_entry( } /* A property follows */ - if (n > ENTRY_FIELD_COUNT_MAX) { + if (n >= ENTRY_FIELD_COUNT_MAX) { log_debug("Received an entry that has more than " STRINGIFY(ENTRY_FIELD_COUNT_MAX) " fields, ignoring entry."); goto finish; }