From fd6f8c5b5963cd84454314fce8870e75fb23de64 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 29 Sep 2022 16:07:41 -0400 Subject: [PATCH] Fix: bytecode interpreter context_get_index() leaves byte order uninitialized 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 Change-Id: I76576a3b9dd87f218e7226095c85590e1eb0beec --- lttng-filter-interpreter.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lttng-filter-interpreter.c b/lttng-filter-interpreter.c index d9dc6195..821c12d3 100644 --- a/lttng-filter-interpreter.c +++ b/lttng-filter-interpreter.c @@ -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: -- 2.34.1