Fix filter: fix stack leak on taken branch
[lttng-ust.git] / liblttng-ust / lttng-filter-interpreter.c
index 2982e52c78a8b42c04188895be0ac90901f7e4f1..dbc3cfeafb5cdaac719a2c1ec38dad933b674d6e 100644 (file)
@@ -572,6 +572,8 @@ int lttng_filter_interpret_bytecode(void *filter_data,
                                        (unsigned int) insn->skip_offset);
                                next_pc = start_pc + insn->skip_offset;
                        } else {
+                               /* Pop 1 when jump not taken */
+                               estack_pop(stack);
                                next_pc += sizeof(struct logical_op);
                        }
                        PO;
@@ -588,6 +590,8 @@ int lttng_filter_interpret_bytecode(void *filter_data,
                                        (unsigned int) insn->skip_offset);
                                next_pc = start_pc + insn->skip_offset;
                        } else {
+                               /* Pop 1 when jump not taken */
+                               estack_pop(stack);
                                next_pc += sizeof(struct logical_op);
                        }
                        PO;
This page took 0.032799 seconds and 4 git commands to generate.