It looks like an agent event's filter expression is NULL when
it's created with -a, for example:
lttng enable-event -j -a
Since there's no check for this in ht_match_event(), strlen()
makes the session daemon segfault with this scenario:
lttng create
lttng enable-event -j -a
lttng disable-event -j -a
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
}
/* Filter expression */
- if (strncmp(event->filter_expression, key->filter_expression,
- strlen(event->filter_expression)) != 0) {
+ if (!!event->filter_expression ^ !!key->filter_expression) {
+ /* One has a filter expression, the other does not */
goto no_match;
}
+ if (event->filter_expression) {
+ if (strncmp(event->filter_expression, key->filter_expression,
+ strlen(event->filter_expression)) != 0) {
+ goto no_match;
+ }
+ }
+
return 1;
no_match: