From: Timo Sirainen Date: Tue, 9 Mar 2021 14:32:35 +0000 (+0200) Subject: lib: event_match_field() - Avoid recursing event fields twice X-Git-Tag: 2.3.16~320 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9177a5788668ac9ea6f366da92e545f4ce3e555;p=thirdparty%2Fdovecot%2Fcore.git lib: event_match_field() - Avoid recursing event fields twice event_find_field() is already recursive. --- diff --git a/src/lib/event-filter.c b/src/lib/event-filter.c index 685b383b6f..434f7c85cf 100644 --- a/src/lib/event-filter.c +++ b/src/lib/event-filter.c @@ -525,13 +525,12 @@ event_match_field(struct event *event, const struct event_field *wanted_field, const struct event_field *field; /* wanted_field has the value in all available formats */ - while ((field = event_find_field(event, wanted_field->key)) == NULL) { - event = event_get_parent(event); - if (event == NULL) { - /* field="" matches nonexistent field */ - return wanted_field->value.str[0] == '\0'; - } + field = event_find_field(event, wanted_field->key); + if (field == NULL) { + /* field="" matches nonexistent field */ + return wanted_field->value.str[0] == '\0'; } + switch (field->value_type) { case EVENT_FIELD_VALUE_TYPE_STR: if (op != EVENT_FILTER_OP_CMP_EQ) {