From b9f4cd79c85f6fcadece77219e5fa8dd5d8932f1 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 1 Oct 2012 18:17:58 -0400 Subject: [PATCH] Fix: filter bytecode specializer stack leak Fixes #356 Signed-off-by: Christian Babeux Signed-off-by: Mathieu Desnoyers --- liblttng-ust/lttng-filter-specialize.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/liblttng-ust/lttng-filter-specialize.c b/liblttng-ust/lttng-filter-specialize.c index b422f508..66e3db6f 100644 --- a/liblttng-ust/lttng-filter-specialize.c +++ b/liblttng-ust/lttng-filter-specialize.c @@ -396,6 +396,12 @@ int lttng_filter_specialize_bytecode(struct bytecode_runtime *bytecode) case FILTER_OP_AND: case FILTER_OP_OR: { + /* Continue to next instruction */ + /* Pop 1 when jump not taken */ + if (vstack_pop(stack)) { + ret = -EINVAL; + goto end; + } next_pc += sizeof(struct logical_op); break; } -- 2.34.1