X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=liblttng-ust%2Flttng-filter.c;fp=liblttng-ust%2Flttng-filter.c;h=2db388dc5a3d9ddc3423ee34ab84ae5ab43d7bf9;hb=b82404da072680a71f4dfca66a24325304151643;hp=d52658ae14dd7f4e135a5e6e0df306069bd94f4b;hpb=9f327dfe52bb19211f4bdef5206e94dd091af55e;p=deliverable%2Flttng-ust.git diff --git a/liblttng-ust/lttng-filter.c b/liblttng-ust/lttng-filter.c index d52658ae..2db388dc 100644 --- a/liblttng-ust/lttng-filter.c +++ b/liblttng-ust/lttng-filter.c @@ -254,9 +254,23 @@ int apply_field_reloc(struct lttng_event *event, op->op = FILTER_OP_LOAD_FIELD_REF_S64; break; case atype_array: + { + 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) + return -EINVAL; + op->op = FILTER_OP_LOAD_FIELD_REF_SEQUENCE; + break; + } case atype_sequence: + { + 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) + return -EINVAL; op->op = FILTER_OP_LOAD_FIELD_REF_SEQUENCE; break; + } case atype_string: op->op = FILTER_OP_LOAD_FIELD_REF_STRING; break; @@ -329,9 +343,25 @@ int apply_context_reloc(struct lttng_event *event, op->op = FILTER_OP_GET_CONTEXT_REF_S64; break; /* Sequence and array supported as string */ - case atype_string: case atype_array: + { + 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) + return -EINVAL; + op->op = FILTER_OP_GET_CONTEXT_REF_STRING; + break; + } case atype_sequence: + { + 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) + return -EINVAL; + op->op = FILTER_OP_GET_CONTEXT_REF_STRING; + break; + } + case atype_string: op->op = FILTER_OP_GET_CONTEXT_REF_STRING; break; case atype_float: