ban_evaluate(): Do not call VRE_match on a NULL subject

Fixes #3706
parent 0e73c0f8
...@@ -568,15 +568,19 @@ ban_evaluate(struct worker *wrk, const uint8_t *bsarg, struct objcore *oc, ...@@ -568,15 +568,19 @@ ban_evaluate(struct worker *wrk, const uint8_t *bsarg, struct objcore *oc,
} }
break; break;
case BANS_OPER_MATCH: case BANS_OPER_MATCH:
if (arg1 == NULL)
return (0);
rv = VRE_match(bt.arg2_spec, arg1, 0, 0, NULL); rv = VRE_match(bt.arg2_spec, arg1, 0, 0, NULL);
xxxassert(rv >= -1); xxxassert(rv >= -1);
if (arg1 == NULL || rv < 0) if (rv < 0)
return (0); return (0);
break; break;
case BANS_OPER_NMATCH: case BANS_OPER_NMATCH:
if (arg1 == NULL)
return (0);
rv = VRE_match(bt.arg2_spec, arg1, 0, 0, NULL); rv = VRE_match(bt.arg2_spec, arg1, 0, 0, NULL);
xxxassert(rv >= -1); xxxassert(rv >= -1);
if (arg1 == NULL || rv >= 0) if (rv >= 0)
return (0); return (0);
break; break;
case BANS_OPER_GT: case BANS_OPER_GT:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment