@@ -1235,6 +1235,11 @@ static apr_status_t msre_action_ctl_execute(modsec_rec *msr, apr_pool_t *mptmp,
1235
1235
if (msr -> txcfg -> debuglog_level >= 4 ) {
1236
1236
msr_log (msr , 4 , "Ctl: ruleRemoveTargetById id=%s targets=%s" , p1 , p2 );
1237
1237
}
1238
+ if (p2 == NULL ) {
1239
+ msr_log (msr , 1 , "ModSecurity: Missing target for id \"%s\"" , p1 );
1240
+ return -1 ;
1241
+ }
1242
+
1238
1243
re = apr_pcalloc (msr -> mp , sizeof (rule_exception ));
1239
1244
re -> type = RULE_EXCEPTION_REMOVE_ID ;
1240
1245
re -> param = (const char * )apr_pstrdup (msr -> mp , p1 );
@@ -1253,10 +1258,10 @@ static apr_status_t msre_action_ctl_execute(modsec_rec *msr, apr_pool_t *mptmp,
1253
1258
if (msr -> txcfg -> debuglog_level >= 4 ) {
1254
1259
msr_log (msr , 4 , "Ctl: ruleRemoveTargetByTag tag=%s targets=%s" , p1 , p2 );
1255
1260
}
1256
- if (p2 == NULL ) {
1261
+ if (p2 == NULL ) {
1257
1262
msr_log (msr , 1 , "ModSecurity: Missing target for tag \"%s\"" , p1 );
1258
- return -1 ;
1259
- }
1263
+ return -1 ;
1264
+ }
1260
1265
1261
1266
re = apr_pcalloc (msr -> mp , sizeof (rule_exception ));
1262
1267
re -> type = RULE_EXCEPTION_REMOVE_TAG ;
@@ -1281,6 +1286,10 @@ static apr_status_t msre_action_ctl_execute(modsec_rec *msr, apr_pool_t *mptmp,
1281
1286
if (msr -> txcfg -> debuglog_level >= 4 ) {
1282
1287
msr_log (msr , 4 , "Ctl: ruleRemoveTargetByMsg msg=%s targets=%s" , p1 , p2 );
1283
1288
}
1289
+ if (p2 == NULL ) {
1290
+ msr_log (msr , 1 , "ModSecurity: Missing target for msg \"%s\"" , p1 );
1291
+ return -1 ;
1292
+ }
1284
1293
1285
1294
re = apr_pcalloc (msr -> mp , sizeof (rule_exception ));
1286
1295
re -> type = RULE_EXCEPTION_REMOVE_MSG ;
0 commit comments