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>
Thu, 24 Sep 2015 02:42:53 +0000 (22:42 -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 dc494161cd60ebedd6b55f19fd402458ca9b9fe7..787f5b8691fa1cea284a772370cdf402e5537a95 100644 (file)
@@ -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;
        }
 
This page took 0.025436 seconds and 4 git commands to generate.