From 71034df1e32a9502b58961327ef2c7a7c556b082 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 12 Apr 2021 15:00:33 -0400 Subject: [PATCH] Fix: properly compare type enumeration Fixes: fead3a9cead4 ("Fix: bytecode linker: validate event and field array/sequence encoding") Fixes: #1304 Signed-off-by: Mathieu Desnoyers Change-Id: I9b5e3df5415d56420365997ce289be7e02a0140e --- lttng-filter.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; -- 2.34.1