Skip to content

Commit

Permalink
filter_modify: check if key exists for not conditions (#4319)
Browse files Browse the repository at this point in the history
Signed-off-by: Takahiro Yamashita <[email protected]>
  • Loading branch information
nokute78 authored and edsiper committed Nov 17, 2021
1 parent 02936a2 commit 24e0764
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/filter_modify/modify.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,9 @@ bool evaluate_condition_KEY_VALUE_DOES_NOT_EQUAL(struct filter_modify_ctx *ctx,
modify_condition
*condition)
{
if (!evaluate_condition_KEY_EXISTS(map, condition)) {
return false;
}
return !evaluate_condition_KEY_VALUE_EQUALS(ctx, map, condition);
}

Expand Down Expand Up @@ -715,6 +718,9 @@ bool evaluate_condition_KEY_VALUE_DOES_NOT_MATCH(struct filter_modify_ctx *ctx,
modify_condition
*condition)
{
if (!evaluate_condition_KEY_EXISTS(map, condition)) {
return false;
}
return !evaluate_condition_KEY_VALUE_MATCHES(ctx, map, condition);
}

Expand Down

0 comments on commit 24e0764

Please sign in to comment.