mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
pcre: a rule with no ACL a match data of its own, not itself
A rule whose ACL was missing was handed to the filters as the connection's data, which they read as a match data block and freed: a pointer into the configuration, dereferenced as another type and given back to malloc. A rule without an ACL now skips the check and goes on with a block of its own, and nothing a filter is given is ever the rule itself.
This commit is contained in:
1 parent
83974cb7ca
commit
a7e5a8b48b
1 file changed
+3
-2
+3
-2
@@ -264,13 +264,14 @@ static FILTER_ACTION pcre_filter_client(void *fo, struct clientparam * param, vo
|
|||||||
struct pcre_filter_data *rule = (struct pcre_filter_data *)fo;
|
struct pcre_filter_data *rule = (struct pcre_filter_data *)fo;
|
||||||
struct pcre_client_data *pcd;
|
struct pcre_client_data *pcd;
|
||||||
|
|
||||||
*fc = fo;
|
*fc = NULL;
|
||||||
if(!fo) return PASS;
|
if(!fo) return PASS;
|
||||||
if(!rule->acl) return CONTINUE;
|
if(rule->acl){
|
||||||
memset (&tmpace, 0, sizeof(struct ace));
|
memset (&tmpace, 0, sizeof(struct ace));
|
||||||
tmpace.src = rule->acl->src;
|
tmpace.src = rule->acl->src;
|
||||||
res = pl->ACLMatches(&tmpace, param);
|
res = pl->ACLMatches(&tmpace, param);
|
||||||
if(!res) return PASS;
|
if(!res) return PASS;
|
||||||
|
}
|
||||||
/* the connection goes on with a match data of its own */
|
/* the connection goes on with a match data of its own */
|
||||||
if(!(pcd = pl->mallocfunc(sizeof(struct pcre_client_data)))){
|
if(!(pcd = pl->mallocfunc(sizeof(struct pcre_client_data)))){
|
||||||
*fc = NULL;
|
*fc = NULL;
|
||||||
|
|||||||
Reference in new issue
Block a user