1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-13 12:58:20 +03:00

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.
This commit is contained in:
Daan De Meyer 2021-09-15 13:05:46 +01:00 committed by Yu Watanabe
parent 08987f9115
commit adbd80f510

View File

@ -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))