From 22e09ae6135a829215f1e4b3d59aa26127846ca1 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 27 Jan 2015 23:33:36 +0000 Subject: [PATCH] [455402] Fix potential hang with pattern acls. Fix hang if pattern acl contains a %u but an anonymous client connect. Thanks to Christoph Krey. Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=455402 --- ChangeLog.txt | 2 ++ src/security_default.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index e2446349..0381ec64 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -64,6 +64,8 @@ Broker: restricted to the root user only. Closes bug #452914. - Usernames and topics given in ACL files can now include a space. Closes bug #431780. +- Fix hang if pattern acl contains a %u but an anonymous client connect. + Closes bug #455402. Clients: - Both clients can now load default configuration options from a file. diff --git a/src/security_default.c b/src/security_default.c index 45bb64b9..daed009d 100644 --- a/src/security_default.c +++ b/src/security_default.c @@ -265,6 +265,7 @@ int mosquitto_acl_check_default(struct mosquitto_db *db, struct mosquitto *conte tlen = strlen(acl_root->topic); if(acl_root->ucount && !context->username){ + acl_root = acl_root->next; continue; } @@ -306,7 +307,6 @@ int mosquitto_acl_check_default(struct mosquitto_db *db, struct mosquitto *conte } } - acl_root = acl_root->next; }