From: Mathieu Desnoyers Date: Mon, 22 Mar 2021 21:32:59 +0000 (-0400) Subject: Fix: properly compare type enumeration X-Git-Url: http://git.efficios.com/?p=deliverable%2Flttng-ust.git;a=commitdiff_plain;h=8d55fb26337009355227ea4da57de62ecbed2fcb Fix: properly compare type enumeration Fixes: b82404da07 ("Fix: bytecode linker: validate event and field array/sequence encoding") Signed-off-by: Mathieu Desnoyers Change-Id: I4a430d36ee08dc65242a5e6ca6bd0a6a689df873 --- diff --git a/liblttng-ust/lttng-filter.c b/liblttng-ust/lttng-filter.c index 2db388dc..947ed843 100644 --- a/liblttng-ust/lttng-filter.c +++ b/liblttng-ust/lttng-filter.c @@ -257,7 +257,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; op->op = FILTER_OP_LOAD_FIELD_REF_SEQUENCE; break; @@ -266,7 +266,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; op->op = FILTER_OP_LOAD_FIELD_REF_SEQUENCE; break; @@ -347,7 +347,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; op->op = FILTER_OP_GET_CONTEXT_REF_STRING; break; @@ -356,7 +356,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; op->op = FILTER_OP_GET_CONTEXT_REF_STRING; break;