Skip to content

Commit

Permalink
lib/filterx: fix scope cloning
Browse files Browse the repository at this point in the history
The newly introduced `log_msg_has_changes` flag should not be copied as
the non-floating variables are not copied either.
This results in improperly tagging the clone as "tainted".

Also the generation counter should be set the previous value instead of 0 because
0 is used for signaling that the value should not be used.

Signed-off-by: Szilard Parrag <szilard.parrag@axoflow.com>
  • Loading branch information
OverOrion committed Oct 31, 2024
1 parent 7bc4bdb commit 551e7d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/filterx/filterx-scope.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ filterx_scope_clone(FilterXScope *other)
g_array_append_val(self->variables, *v);
FilterXVariable *v_clone = &g_array_index(self->variables, FilterXVariable, dst_index);

filterx_variable_set_generation(v_clone, 0);
filterx_variable_set_generation(v_clone, v->generation);
if (v->value)
v_clone->value = filterx_object_clone(v->value);
else
Expand All @@ -316,7 +316,7 @@ filterx_scope_clone(FilterXScope *other)
if (other->variables->len > 0)
self->dirty = other->dirty;
self->syncable = other->syncable;
self->log_msg_has_changes = other->log_msg_has_changes;

msg_trace("Filterx clone finished",
evt_tag_printf("scope", "%p", self),
evt_tag_printf("other", "%p", other),
Expand Down

0 comments on commit 551e7d9

Please sign in to comment.