weston-log: Avoid prefix-matching the scope name when checking for a
authorMarius Vlad <marius.vlad@collabora.com>
Tue, 5 Nov 2019 15:08:17 +0000 (17:08 +0200)
committerMarius Vlad <marius.vlad@collabora.com>
Tue, 5 Nov 2019 15:08:17 +0000 (17:08 +0200)
pending subscription

It limits to scope name to an exact match.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Reported-by: Pekka Paalanen <pekka.paalanen@collabora.com>
libweston/weston-log.c

index 9415f053c1ada170c4f33c366202ccd75bb4ab60..b2c4597c7f1a1b6618ad90ed047d05dc0eca2da4 100644 (file)
@@ -124,7 +124,7 @@ find_pending_subscription(struct weston_log_context *log_ctx,
        struct weston_log_subscription *sub;
 
        wl_list_for_each(sub, &log_ctx->pending_subscription_list, source_link)
-               if (!strncmp(sub->scope_name, scope_name, strlen(scope_name)))
+               if (!strcmp(sub->scope_name, scope_name))
                        return sub;
 
        return NULL;