Fix: bytecode interpreter context_get_index() leaves byte order uninitialized
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 29 Sep 2022 20:07:41 +0000 (16:07 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 29 Sep 2022 21:01:54 +0000 (17:01 -0400)
Within the bytecode interpreter, context_get_index() leaves the "rev_bo"
field uninitialized in the top of stack.

Initialize the rev_bo field based on the context field type
reserve_byte_order field.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I76576a3b9dd87f218e7226095c85590e1eb0beec

lttng-filter-interpreter.c

index d9dc6195f2f78cf1d683b48e046be01e2383f124..821c12d3ba9679e5ae605ae5189a639529b8c5fd 100644 (file)
@@ -290,6 +290,7 @@ static int context_get_index(struct lttng_probe_ctx *lttng_probe_ctx,
                        ptr->u.u64 = v.s64;     /* Cast. */
                        ptr->ptr = &ptr->u.u64;
                }
+               ptr->rev_bo = field->type.u.basic.integer.reverse_byte_order;
                break;
        case atype_enum:
        {
@@ -306,6 +307,7 @@ static int context_get_index(struct lttng_probe_ctx *lttng_probe_ctx,
                        ptr->u.u64 = v.s64;     /* Cast. */
                        ptr->ptr = &ptr->u.u64;
                }
+               ptr->rev_bo = itype->reverse_byte_order;
                break;
        }
        case atype_array:
This page took 0.027396 seconds and 4 git commands to generate.