From: Mathieu Desnoyers Date: Wed, 27 Mar 2013 14:50:56 +0000 (-0400) Subject: Fix: filter string wildcard comparison X-Git-Tag: v2.2.0-rc1~9 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a0928c1ea95223e475637e429235a321228d7b71;p=lttng-ust.git Fix: filter string wildcard comparison wildcards * should match 0 or more characters (not 1 or more). Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust/lttng-filter-interpreter.c b/liblttng-ust/lttng-filter-interpreter.c index 4b75f0bc..8d74e7f9 100644 --- a/liblttng-ust/lttng-filter-interpreter.c +++ b/liblttng-ust/lttng-filter-interpreter.c @@ -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) {