Skip to content

Commit 9ac9ff8

Browse files
author
Felipe Zimmerle
committed
Adds a sanity check before use ctl:ruleRemoveTargetByTag
This commit closes the issue #1353
1 parent 112ba45 commit 9ac9ff8

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGES

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
DD MMM YYYY - 2.9.2 - To be released
22
------------------------------------
33

4+
* Adds a sanity check before use ctl:ruleRemoveTargetByTag.
5+
[Issue #1353 - @LukeP21 and @zimmerle]
46
* Uses an optional global lock while manipulating collections.
57
[Issues #1224 - @mturk and @zimmerle]
68
* Fix collection naming problem while merging collections.

apache2/re_actions.c

+4
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,10 @@ static apr_status_t msre_action_ctl_execute(modsec_rec *msr, apr_pool_t *mptmp,
12531253
if (msr->txcfg->debuglog_level >= 4) {
12541254
msr_log(msr, 4, "Ctl: ruleRemoveTargetByTag tag=%s targets=%s", p1, p2);
12551255
}
1256+
if (p2 == NULL) {
1257+
msr_log(msr, 1, "ModSecurity: Missing target for tag \"%s\"", p1);
1258+
return -1;
1259+
}
12561260

12571261
re = apr_pcalloc(msr->mp, sizeof(rule_exception));
12581262
re->type = RULE_EXCEPTION_REMOVE_TAG;

0 commit comments

Comments
 (0)