Fix Coverity Scan 1499812, 1499810

pull/2558/merge
Roger A. Light 3 years ago
parent 7f0e5cd809
commit 6dc27d8214

@ -135,7 +135,10 @@ static int acl_check_subscribe(struct dynsec__data *data, struct mosquitto_evt_a
}
}
HASH_ITER(hh, rolelist->role->acls.subscribe_pattern, acl, acl_tmp){
mosquitto_sub_matches_acl_with_pattern(acl->topic, ed->topic, clientid, username, &result);
if(mosquitto_sub_matches_acl_with_pattern(acl->topic, ed->topic, clientid, username, &result)){
/* Invalid input, so deny */
return MOSQ_ERR_ACL_DENIED;
}
if(result){
if(acl->allow){
return MOSQ_ERR_SUCCESS;
@ -180,7 +183,10 @@ static int acl_check_unsubscribe(struct dynsec__data *data, struct mosquitto_evt
}
}
HASH_ITER(hh, rolelist->role->acls.unsubscribe_pattern, acl, acl_tmp){
mosquitto_sub_matches_acl_with_pattern(acl->topic, ed->topic, clientid, username, &result);
if(mosquitto_sub_matches_acl_with_pattern(acl->topic, ed->topic, clientid, username, &result)){
/* Invalid input, so deny */
return MOSQ_ERR_ACL_DENIED;
}
if(result){
if(acl->allow){
return MOSQ_ERR_SUCCESS;

Loading…
Cancel
Save