From: Jérémie Galarneau Date: Sat, 5 Sep 2015 19:35:42 +0000 (-0400) Subject: Fix: Buggy string comparison in ust registry ht_match_event X-Git-Tag: v2.6.1~23 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c07b43b4a3bf94c8ea67261bd04a04607c4d3b2b;p=lttng-tools.git Fix: Buggy string comparison in ust registry ht_match_event The second strncmp compares the first "strlen(event->signature) != 0" characters of the event signatures because of a missing parenthesis. Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/ust-registry.c b/src/bin/lttng-sessiond/ust-registry.c index dc494161c..787f5b869 100644 --- a/src/bin/lttng-sessiond/ust-registry.c +++ b/src/bin/lttng-sessiond/ust-registry.c @@ -42,13 +42,13 @@ static int ht_match_event(struct cds_lfht_node *node, const void *_key) key = _key; /* It has to be a perfect match. */ - if (strncmp(event->name, key->name, sizeof(event->name)) != 0) { + if (strncmp(event->name, key->name, sizeof(event->name))) { goto no_match; } /* It has to be a perfect match. */ if (strncmp(event->signature, key->signature, - strlen(event->signature) != 0)) { + strlen(event->signature))) { goto no_match; }