Adds a sanity check before use ctl:ruleRemoveTargetByTag

This commit closes the issue #1353
This commit is contained in:
Felipe Zimmerle
2017-05-22 09:21:13 -03:00
parent 112ba45e7a
commit 9ac9ff8223
2 changed files with 6 additions and 0 deletions

View File

@@ -1253,6 +1253,10 @@ static apr_status_t msre_action_ctl_execute(modsec_rec *msr, apr_pool_t *mptmp,
if (msr->txcfg->debuglog_level >= 4) {
msr_log(msr, 4, "Ctl: ruleRemoveTargetByTag tag=%s targets=%s", p1, p2);
}
if (p2 == NULL) {
msr_log(msr, 1, "ModSecurity: Missing target for tag \"%s\"", p1);
return -1;
}
re = apr_pcalloc(msr->mp, sizeof(rule_exception));
re->type = RULE_EXCEPTION_REMOVE_TAG;