From b4d096a6292e78c601dba161dbb15f48ad89935f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Sat, 5 Sep 2015 15:35:42 -0400 Subject: [PATCH 1/1] Fix: Buggy string comparison in ust registry ht_match_event MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/bin/lttng-sessiond/ust-registry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/lttng-sessiond/ust-registry.c b/src/bin/lttng-sessiond/ust-registry.c index 35911e322..3f1390dc3 100644 --- a/src/bin/lttng-sessiond/ust-registry.c +++ b/src/bin/lttng-sessiond/ust-registry.c @@ -43,13 +43,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; } -- 2.34.1