From: Mathieu Desnoyers Date: Mon, 12 Apr 2021 19:00:33 +0000 (-0400) Subject: Fix: properly compare type enumeration X-Git-Tag: v2.11.9~12 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=8e2637068252be8940b7f99a61e86b1bd91df95a;p=lttng-modules.git Fix: properly compare type enumeration Fixes: 5f7779c5265d ("Fix: bytecode linker: validate event and field array/sequence encoding") Fixes: #1304 Signed-off-by: Mathieu Desnoyers Change-Id: I9b5e3df5415d56420365997ce289be7e02a0140e --- diff --git a/lttng-filter.c b/lttng-filter.c index c33fa5f2..05ce683e 100644 --- a/lttng-filter.c +++ b/lttng-filter.c @@ -244,7 +244,7 @@ int apply_field_reloc(struct lttng_event *event, { const struct lttng_basic_type *elem_type = &field->type.u.array.elem_type; - if (elem_type != atype_integer || elem_type->u.basic.integer.encoding == lttng_encode_none) + if (elem_type->atype != atype_integer || elem_type->u.basic.integer.encoding == lttng_encode_none) return -EINVAL; if (field->user) op->op = FILTER_OP_LOAD_FIELD_REF_USER_SEQUENCE; @@ -256,7 +256,7 @@ int apply_field_reloc(struct lttng_event *event, { const struct lttng_basic_type *elem_type = &field->type.u.sequence.elem_type; - if (elem_type != atype_integer || elem_type->u.basic.integer.encoding == lttng_encode_none) + if (elem_type->atype != atype_integer || elem_type->u.basic.integer.encoding == lttng_encode_none) return -EINVAL; if (field->user) op->op = FILTER_OP_LOAD_FIELD_REF_USER_SEQUENCE; @@ -332,7 +332,7 @@ int apply_context_reloc(struct lttng_event *event, { const struct lttng_basic_type *elem_type = &ctx_field->event_field.type.u.array.elem_type; - if (elem_type != atype_integer || elem_type->u.basic.integer.encoding == lttng_encode_none) + if (elem_type->atype != atype_integer || elem_type->u.basic.integer.encoding == lttng_encode_none) return -EINVAL; BUG_ON(ctx_field->event_field.user); op->op = FILTER_OP_GET_CONTEXT_REF_STRING; @@ -342,7 +342,7 @@ int apply_context_reloc(struct lttng_event *event, { const struct lttng_basic_type *elem_type = &ctx_field->event_field.type.u.sequence.elem_type; - if (elem_type != atype_integer || elem_type->u.basic.integer.encoding == lttng_encode_none) + if (elem_type->atype != atype_integer || elem_type->u.basic.integer.encoding == lttng_encode_none) return -EINVAL; BUG_ON(ctx_field->event_field.user); op->op = FILTER_OP_GET_CONTEXT_REF_STRING;