Filter: validate that field ref strings are non-NULL
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 16 Jul 2012 14:39:19 +0000 (10:39 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 16 Jul 2012 14:39:19 +0000 (10:39 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-filter.c

index db4d107a63df629f07af9c3b2cf6f82858cd92bc..19775c3098c939a3d1d9b496e453c6cfd49dcd3d 100644 (file)
@@ -696,6 +696,11 @@ int lttng_filter_interpret_bytecode(void *filter_data,
                                ref->offset);
                        reg[insn->reg].str =
                                *(const char * const *) &filter_stack_data[ref->offset];
+                       if (unlikely(!reg[insn->reg].str)) {
+                               dbg_printf("Filter warning: loading a NULL string.\n");
+                               ret = -EINVAL;
+                               goto end;
+                       }
                        reg[insn->reg].type = REG_STRING;
                        reg[insn->reg].seq_len = UINT_MAX;
                        reg[insn->reg].literal = 0;
@@ -716,6 +721,11 @@ int lttng_filter_interpret_bytecode(void *filter_data,
                        reg[insn->reg].str =
                                *(const char **) (&filter_stack_data[ref->offset
                                                                + sizeof(unsigned long)]);
+                       if (unlikely(!reg[insn->reg].str)) {
+                               dbg_printf("Filter warning: loading a NULL sequence.\n");
+                               ret = -EINVAL;
+                               goto end;
+                       }
                        reg[insn->reg].type = REG_STRING;
                        reg[insn->reg].literal = 0;
                        next_pc += sizeof(struct load_op) + sizeof(struct field_ref);
This page took 0.026692 seconds and 4 git commands to generate.