mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-16 06:05:50 +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.
(cherry picked from commit a7e5a8b48b)
This commit is contained in:
parent
b03cd28dff
commit
15012177aa
13
src/pcre.c
13
src/pcre.c
@ -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;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user