From: Daan De Meyer Date: Wed, 15 Sep 2021 12:05:46 +0000 (+0100) Subject: sd-journal: Ignore data threshold if set to zero in sd_journal_enumerate_fields() X-Git-Tag: v250-rc1~668 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=adbd80f51088058d55e703abe0ac11476cfe0ba4;p=thirdparty%2Fsystemd.git sd-journal: Ignore data threshold if set to zero in sd_journal_enumerate_fields() According to the documentation, Setting the data threshold to zero disables the data threshold alltogether. Let's make sure we actually implement this behaviour in sd_journal_enumerate_fields() by only applying the data threshold if it exceeds zero. --- diff --git a/src/libsystemd/sd-journal/sd-journal.c b/src/libsystemd/sd-journal/sd-journal.c index c6694bda95f..fbd2fb38bbf 100644 --- a/src/libsystemd/sd-journal/sd-journal.c +++ b/src/libsystemd/sd-journal/sd-journal.c @@ -3174,7 +3174,7 @@ _public_ int sd_journal_enumerate_fields(sd_journal *j, const char **field) { if (memchr(o->field.payload, 0, sz)) return -EBADMSG; - if (sz > j->data_threshold) + if (j->data_threshold > 0 && sz > j->data_threshold) sz = j->data_threshold; if (!GREEDY_REALLOC(j->fields_buffer, sz + 1))