Fix: Buggy string comparison in ust registry ht_match_event
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 5 Sep 2015 19:35:42 +0000 (15:35 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 5 Sep 2015 19:36:05 +0000 (15:36 -0400)
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 <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/ust-registry.c

index 35911e322f49175a29e58f0784b32c966ca7f7db..3f1390dc3df1e65449700c12fa502215a9e29426 100644 (file)
@@ -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;
        }
 
This page took 0.026762 seconds and 4 git commands to generate.