<div dir="ltr">Oh, Janine hijacked my workstation again!</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">Philippe Proulx</div></div>
<br><div class="gmail_quote">On Fri, Jun 17, 2016 at 10:36 PM, Mathieu Desnoyers <span dir="ltr"><<a href="mailto:mathieu.desnoyers@efficios.com" target="_blank">mathieu.desnoyers@efficios.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Received: from jsutto (<a href="http://cable-192.222.213.99.electronicbox.net" rel="noreferrer" target="_blank">cable-192.222.213.99.electronicbox.net</a>.<br>
<br>
host <a href="http://mtl.efficios.com" rel="noreferrer" target="_blank">mtl.efficios.com</a><br>
<a href="http://mtl.efficios.com" rel="noreferrer" target="_blank">mtl.efficios.com</a> has address 192.222.213.99<br>
<br>
Nice try Phil. ;-)<br>
<br>
We'll need the actual contributor name to merge this contribution<br>
however. I'm pretty sure there is no Mrs. Sutto at EfficiOS.<br>
<br>
Thanks,<br>
<br>
Mathieu<br>
<div class="HOEnZb"><div class="h5"><br>
----- On Jun 15, 2016, at 5:34 PM, Janine Sutto <a href="mailto:janinesutto@gmail.com">janinesutto@gmail.com</a> wrote:<br>
<br>
> It looks like an agent event's filter expression is NULL when<br>
> it's created with -a, for example:<br>
><br>
>    lttng enable-event -j -a<br>
><br>
> Since there's no check for this in ht_match_event(), strlen()<br>
> makes the session daemon segfault with this scenario:<br>
><br>
>    lttng create<br>
>    lttng enable-event -j -a<br>
>    lttng disable-event -j -a<br>
><br>
> Signed-off-by: Janine Sutto <<a href="mailto:janinesutto@gmail.com">janinesutto@gmail.com</a>><br>
> ---<br>
> src/bin/lttng-sessiond/agent.c | 11 +++++++++--<br>
> 1 file changed, 9 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/src/bin/lttng-sessiond/agent.c b/src/bin/lttng-sessiond/agent.c<br>
> index 8e1ef08..7cbbbde 100644<br>
> --- a/src/bin/lttng-sessiond/agent.c<br>
> +++ b/src/bin/lttng-sessiond/agent.c<br>
> @@ -143,11 +143,18 @@ static int ht_match_event(struct cds_lfht_node *node,<br>
>       }<br>
><br>
>       /* Filter expression */<br>
> -     if (strncmp(event->filter_expression, key->filter_expression,<br>
> -                     strlen(event->filter_expression)) != 0) {<br>
> +     if (!!event->filter_expression ^ !!key->filter_expression) {<br>
> +             /* One has a filter expression, the other does not */<br>
>               goto no_match;<br>
>       }<br>
><br>
> +     if (event->filter_expression) {<br>
> +             if (strncmp(event->filter_expression, key->filter_expression,<br>
> +                             strlen(event->filter_expression)) != 0) {<br>
> +                     goto no_match;<br>
> +             }<br>
> +     }<br>
> +<br>
>       return 1;<br>
><br>
> no_match:<br>
> --<br>
> 2.8.3<br>
><br>
> _______________________________________________<br>
> lttng-dev mailing list<br>
> <a href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a><br>
> <a href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" rel="noreferrer" target="_blank">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Mathieu Desnoyers<br>
EfficiOS Inc.<br>
<a href="http://www.efficios.com" rel="noreferrer" target="_blank">http://www.efficios.com</a><br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
lttng-dev mailing list<br>
<a href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a><br>
<a href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" rel="noreferrer" target="_blank">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
</div></div></blockquote></div><br></div>