Fix possible crash when using pattern ACLs.

pull/211/merge
Roger A. Light 11 years ago
parent 3a4d1da697
commit 28404350c4

@ -1,3 +1,7 @@
Broker:
- Fix possible crash when using pattern ACLs.
1.4 - 20150218
==============

@ -102,7 +102,7 @@ struct mqtt3_config {
bool log_timestamp;
char *log_file;
FILE *log_fptr;
int message_size_limit;
uint32_t message_size_limit;
char *password_file;
bool persistence;
char *persistence_location;

@ -136,6 +136,8 @@ int _add_acl(struct mosquitto_db *db, const char *user, const char *topic, int a
acl->access = access;
acl->topic = local_topic;
acl->next = NULL;
acl->ccount = 0;
acl->ucount = 0;
/* Add acl to user acl list */
if(acl_user->acl){
@ -196,7 +198,7 @@ int _add_acl_pattern(struct mosquitto_db *db, const char *topic, int access)
}
}
acl->ccount = 0;
acl->ucount = 0;
s = local_topic;
while(s){
s = strstr(s, "%u");

Loading…
Cancel
Save