Fix: filter string wildcard comparison
[lttng-ust.git] / liblttng-ust / lttng-filter-interpreter.c
index 690ebde9eece5e1dbb4695e067f014d895bf8a73..8d74e7f9615461f1421f1042ee49234c64f33175 100644 (file)
@@ -59,17 +59,27 @@ int stack_strcmp(struct estack *stack, int top, const char *cmp_type)
                int escaped_r0 = 0;
 
                if (unlikely(p - estack_bx(stack, top)->u.s.str > estack_bx(stack, top)->u.s.seq_len || *p == '\0')) {
-                       if (q - estack_ax(stack, top)->u.s.str > estack_ax(stack, top)->u.s.seq_len || *q == '\0')
+                       if (q - estack_ax(stack, top)->u.s.str > estack_ax(stack, top)->u.s.seq_len || *q == '\0') {
                                diff = 0;
-                       else
-                               diff = -1;
+                       } else {
+                               ret = parse_char(&q);
+                               if (ret == -1)
+                                       diff = 0;
+                               else
+                                       diff = -1;
+                       }
                        break;
                }
                if (unlikely(q - estack_ax(stack, top)->u.s.str > estack_ax(stack, top)->u.s.seq_len || *q == '\0')) {
-                       if (p - estack_bx(stack, top)->u.s.str > estack_bx(stack, top)->u.s.seq_len || *p == '\0')
+                       if (p - estack_bx(stack, top)->u.s.str > estack_bx(stack, top)->u.s.seq_len || *p == '\0') {
                                diff = 0;
-                       else
-                               diff = 1;
+                       } else {
+                               ret = parse_char(&p);
+                               if (ret == -1)
+                                       diff = 0;
+                               else
+                                       diff = 1;
+                       }
                        break;
                }
                if (estack_bx(stack, top)->u.s.literal) {
@@ -168,7 +178,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data,
        struct bytecode_runtime *bytecode = filter_data;
        void *pc, *next_pc, *start_pc;
        int ret = -EINVAL;
-       int retval = 0;
+       uint64_t retval = 0;
        struct estack _stack;
        struct estack *stack = &_stack;
        register int64_t ax = 0, bx = 0;
This page took 0.025041 seconds and 4 git commands to generate.