Fix: properly compare type enumeration
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 12 Apr 2021 19:00:33 +0000 (15:00 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 12 Apr 2021 19:02:09 +0000 (15:02 -0400)
Fixes: 5f7779c5265d ("Fix: bytecode linker: validate event and field array/sequence encoding")
Fixes: #1304
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I9b5e3df5415d56420365997ce289be7e02a0140e

lttng-filter.c

index c33fa5f281c77be6714be9ecbfe85b2a2c0787cc..05ce683ee72121a659cf620dcca2c3dcefb593c2 100644 (file)
@@ -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;
This page took 0.02752 seconds and 4 git commands to generate.