From: Mathieu Desnoyers Date: Mon, 1 Oct 2012 22:17:58 +0000 (-0400) Subject: Fix: filter bytecode specializer stack leak X-Git-Tag: v2.1.0-rc2~33 X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;ds=sidebyside;h=b9f4cd79c85f6fcadece77219e5fa8dd5d8932f1;p=lttng-ust.git Fix: filter bytecode specializer stack leak Fixes #356 Signed-off-by: Christian Babeux Signed-off-by: Mathieu Desnoyers --- 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; }