mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Fixed assert() usage:
- added some missing - removed some invalid - removed some that were not relevant in the context of the current function, when done in a called function
This commit is contained in:
@@ -27,6 +27,8 @@ static void msre_engine_action_register(msre_engine *engine, const char *name,
|
||||
unsigned int cardinality_group, fn_action_validate_t validate,
|
||||
fn_action_init_t init, fn_action_execute_t execute)
|
||||
{
|
||||
assert(engine != NULL);
|
||||
assert(name != NULL);
|
||||
msre_action_metadata *metadata = (msre_action_metadata *)apr_pcalloc(engine->mp,
|
||||
sizeof(msre_action_metadata));
|
||||
if (metadata == NULL) return;
|
||||
@@ -93,6 +95,8 @@ msre_var *generate_single_var(modsec_rec *msr, msre_var *var, apr_array_header_t
|
||||
rvar->value = rval;
|
||||
rvar->value_len = rval_len;
|
||||
|
||||
assert(msr != NULL);
|
||||
assert(msr->txcfg != NULL);
|
||||
if (msr->txcfg->debuglog_level >= 9) {
|
||||
msr_log(msr, 9, "T (%d) %s: \"%s\"", rc, tfn->name,
|
||||
log_escape_nq_ex(mptmp, rvar->value, rvar->value_len));
|
||||
@@ -172,6 +176,7 @@ apr_table_t *generate_multi_var(modsec_rec *msr, msre_var *var, apr_array_header
|
||||
*/
|
||||
int expand_macros(modsec_rec *msr, msc_string *var, msre_rule *rule, apr_pool_t *mptmp) {
|
||||
assert(msr != NULL);
|
||||
assert(msr->txcfg != NULL);
|
||||
assert(var != NULL);
|
||||
char *data = NULL;
|
||||
apr_array_header_t *arr = NULL;
|
||||
@@ -321,6 +326,7 @@ int expand_macros(modsec_rec *msr, msc_string *var, msre_rule *rule, apr_pool_t
|
||||
*/
|
||||
apr_status_t collection_original_setvar(modsec_rec *msr, const char *col_name, const msc_string *orig_var) {
|
||||
assert(msr != NULL);
|
||||
assert(msr->txcfg != NULL);
|
||||
apr_table_t *table = NULL;
|
||||
msc_string *var = NULL;
|
||||
const char *var_name = NULL;
|
||||
@@ -379,6 +385,8 @@ apr_status_t collection_original_setvar(modsec_rec *msr, const char *col_name, c
|
||||
static apr_status_t msre_action_marker_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
actionset->id = action->param;
|
||||
return 1;
|
||||
}
|
||||
@@ -388,6 +396,8 @@ static apr_status_t msre_action_marker_init(msre_engine *engine, apr_pool_t *mp,
|
||||
static apr_status_t msre_action_id_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
actionset->id = action->param;
|
||||
return 1;
|
||||
}
|
||||
@@ -414,6 +424,8 @@ static char *msre_action_id_validate(msre_engine *engine, apr_pool_t *mp, msre_a
|
||||
static apr_status_t msre_action_rev_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
actionset->rev = action->param;
|
||||
return 1;
|
||||
}
|
||||
@@ -423,6 +435,8 @@ static apr_status_t msre_action_rev_init(msre_engine *engine, apr_pool_t *mp, ms
|
||||
static apr_status_t msre_action_msg_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
actionset->msg = action->param;
|
||||
return 1;
|
||||
}
|
||||
@@ -432,6 +446,8 @@ static apr_status_t msre_action_msg_init(msre_engine *engine, apr_pool_t *mp, ms
|
||||
static apr_status_t msre_action_logdata_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
actionset->logdata = action->param;
|
||||
return 1;
|
||||
}
|
||||
@@ -441,6 +457,8 @@ static apr_status_t msre_action_logdata_init(msre_engine *engine, apr_pool_t *mp
|
||||
static apr_status_t msre_action_sanitizeMatchedBytes_init(msre_engine *engine, apr_pool_t *mp,
|
||||
msre_actionset *actionset, msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
char *parse_parm = NULL;
|
||||
char *ac_param = NULL;
|
||||
char *savedptr = NULL;
|
||||
@@ -469,6 +487,8 @@ static apr_status_t msre_action_sanitizeMatchedBytes_init(msre_engine *engine, a
|
||||
static apr_status_t msre_action_accuracy_init(msre_engine *engine, apr_pool_t *mp,
|
||||
msre_actionset *actionset, msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
actionset->accuracy = atoi(action->param);
|
||||
return 1;
|
||||
}
|
||||
@@ -478,6 +498,8 @@ static apr_status_t msre_action_accuracy_init(msre_engine *engine, apr_pool_t *m
|
||||
static apr_status_t msre_action_maturity_init(msre_engine *engine, apr_pool_t *mp,
|
||||
msre_actionset *actionset, msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
actionset->maturity = atoi(action->param);
|
||||
return 1;
|
||||
}
|
||||
@@ -487,6 +509,8 @@ static apr_status_t msre_action_maturity_init(msre_engine *engine, apr_pool_t *m
|
||||
static apr_status_t msre_action_ver_init(msre_engine *engine, apr_pool_t *mp,
|
||||
msre_actionset *actionset, msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
actionset->version = action->param;
|
||||
return 1;
|
||||
}
|
||||
@@ -496,6 +520,8 @@ static apr_status_t msre_action_ver_init(msre_engine *engine, apr_pool_t *mp,
|
||||
static apr_status_t msre_action_severity_init(msre_engine *engine, apr_pool_t *mp,
|
||||
msre_actionset *actionset, msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
if (strcasecmp(action->param, "emergency") == 0) {
|
||||
actionset->severity = 0;
|
||||
} else if (strcasecmp(action->param, "alert") == 0) {
|
||||
@@ -523,6 +549,7 @@ static apr_status_t msre_action_severity_init(msre_engine *engine, apr_pool_t *m
|
||||
static apr_status_t msre_action_chain_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
actionset->is_chained = 1;
|
||||
return 1;
|
||||
}
|
||||
@@ -531,6 +558,7 @@ static apr_status_t msre_action_chain_init(msre_engine *engine, apr_pool_t *mp,
|
||||
static apr_status_t msre_action_log_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
actionset->log = 1;
|
||||
return 1;
|
||||
}
|
||||
@@ -539,6 +567,7 @@ static apr_status_t msre_action_log_init(msre_engine *engine, apr_pool_t *mp, ms
|
||||
static apr_status_t msre_action_nolog_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
actionset->log = 0;
|
||||
actionset->auditlog = 0;
|
||||
return 1;
|
||||
@@ -548,6 +577,7 @@ static apr_status_t msre_action_nolog_init(msre_engine *engine, apr_pool_t *mp,
|
||||
static apr_status_t msre_action_auditlog_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
actionset->auditlog = 1;
|
||||
return 1;
|
||||
}
|
||||
@@ -556,6 +586,7 @@ static apr_status_t msre_action_auditlog_init(msre_engine *engine, apr_pool_t *m
|
||||
static apr_status_t msre_action_noauditlog_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
actionset->auditlog = 0;
|
||||
return 1;
|
||||
}
|
||||
@@ -564,6 +595,7 @@ static apr_status_t msre_action_noauditlog_init(msre_engine *engine, apr_pool_t
|
||||
static apr_status_t msre_action_block_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
/* Right now we just set a flag and inherit the real disruptive action */
|
||||
actionset->block = 1;
|
||||
return 1;
|
||||
@@ -573,6 +605,7 @@ static apr_status_t msre_action_block_init(msre_engine *engine, apr_pool_t *mp,
|
||||
static apr_status_t msre_action_deny_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
actionset->intercept_action = ACTION_DENY;
|
||||
actionset->intercept_action_rec = action;
|
||||
return 1;
|
||||
@@ -587,6 +620,8 @@ static char *msre_action_status_validate(msre_engine *engine, apr_pool_t *mp, ms
|
||||
static apr_status_t msre_action_status_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
actionset->intercept_status = atoi(action->param);
|
||||
return 1;
|
||||
}
|
||||
@@ -595,6 +630,8 @@ static apr_status_t msre_action_status_init(msre_engine *engine, apr_pool_t *mp,
|
||||
static apr_status_t msre_action_drop_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
actionset->intercept_action = ACTION_DROP;
|
||||
actionset->intercept_action_rec = action;
|
||||
return 1;
|
||||
@@ -609,6 +646,8 @@ static char *msre_action_pause_validate(msre_engine *engine, apr_pool_t *mp, msr
|
||||
static apr_status_t msre_action_pause_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
actionset->intercept_action = ACTION_PAUSE;
|
||||
actionset->intercept_pause = action->param;
|
||||
return 1;
|
||||
@@ -624,6 +663,8 @@ static char *msre_action_redirect_validate(msre_engine *engine, apr_pool_t *mp,
|
||||
static apr_status_t msre_action_redirect_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
actionset->intercept_action = ACTION_REDIRECT;
|
||||
actionset->intercept_uri = action->param;
|
||||
actionset->intercept_action_rec = action;
|
||||
@@ -634,6 +675,8 @@ static apr_status_t msre_action_redirect_execute(modsec_rec *msr, apr_pool_t *mp
|
||||
msre_rule *rule, msre_action *action)
|
||||
{
|
||||
assert(msr != NULL);
|
||||
assert(rule != NULL);
|
||||
assert(rule->actionset != NULL);
|
||||
assert(action != NULL);
|
||||
msc_string *var = NULL;
|
||||
|
||||
@@ -658,6 +701,8 @@ static char *msre_action_proxy_validate(msre_engine *engine, apr_pool_t *mp, msr
|
||||
static apr_status_t msre_action_proxy_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
actionset->intercept_action = ACTION_PROXY;
|
||||
actionset->intercept_uri = action->param;
|
||||
actionset->intercept_action_rec = action;
|
||||
@@ -668,6 +713,7 @@ static apr_status_t msre_action_proxy_execute(modsec_rec *msr, apr_pool_t *mptmp
|
||||
msre_rule *rule, msre_action *action)
|
||||
{
|
||||
assert(msr != NULL);
|
||||
assert(rule != NULL);
|
||||
assert(action != NULL);
|
||||
msc_string *var = NULL;
|
||||
|
||||
@@ -692,6 +738,8 @@ static apr_status_t msre_action_proxy_execute(modsec_rec *msr, apr_pool_t *mptmp
|
||||
static apr_status_t msre_action_pass_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
actionset->intercept_action = ACTION_NONE;
|
||||
actionset->intercept_action_rec = action;
|
||||
return 1;
|
||||
@@ -707,6 +755,8 @@ static char *msre_action_skip_validate(msre_engine *engine, apr_pool_t *mp, msre
|
||||
static apr_status_t msre_action_skip_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
actionset->skip_count = atoi(action->param);
|
||||
if (actionset->skip_count <= 0) actionset->skip_count = 1;
|
||||
return 1;
|
||||
@@ -722,6 +772,8 @@ static char *msre_action_skipAfter_validate(msre_engine *engine, apr_pool_t *mp,
|
||||
static apr_status_t msre_action_skipAfter_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
actionset->skip_after = action->param;
|
||||
return 1;
|
||||
}
|
||||
@@ -731,6 +783,8 @@ static apr_status_t msre_action_skipAfter_init(msre_engine *engine, apr_pool_t *
|
||||
static apr_status_t msre_action_allow_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
actionset->intercept_action = ACTION_ALLOW;
|
||||
actionset->intercept_action_rec = action;
|
||||
|
||||
@@ -747,6 +801,7 @@ static apr_status_t msre_action_allow_init(msre_engine *engine, apr_pool_t *mp,
|
||||
}
|
||||
|
||||
static char *msre_action_allow_validate(msre_engine *engine, apr_pool_t *mp, msre_action *action) {
|
||||
assert(action != NULL);
|
||||
if (action->param != NULL) {
|
||||
if (strcasecmp(action->param, "phase") == 0) {
|
||||
return NULL;
|
||||
@@ -771,6 +826,8 @@ static char *msre_action_phase_validate(msre_engine *engine, apr_pool_t *mp, msr
|
||||
static apr_status_t msre_action_phase_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(actionset != NULL);
|
||||
assert(action != NULL);
|
||||
if(strcasecmp(action->param,"request") == 0)
|
||||
actionset->phase = 2;
|
||||
else if(strcasecmp(action->param,"response") == 0)
|
||||
@@ -786,6 +843,7 @@ static apr_status_t msre_action_phase_init(msre_engine *engine, apr_pool_t *mp,
|
||||
/* t */
|
||||
|
||||
static char *msre_action_t_validate(msre_engine *engine, apr_pool_t *mp, msre_action *action) {
|
||||
assert(action != NULL);
|
||||
msre_tfn_metadata *metadata = NULL;
|
||||
metadata = msre_engine_tfn_resolve(engine, action->param);
|
||||
if (metadata == NULL) return apr_psprintf(mp, "Invalid transformation function: %s",
|
||||
@@ -797,6 +855,7 @@ static char *msre_action_t_validate(msre_engine *engine, apr_pool_t *mp, msre_ac
|
||||
static apr_status_t msre_action_t_init(msre_engine *engine, apr_pool_t *mp, msre_actionset *actionset,
|
||||
msre_action *action)
|
||||
{
|
||||
assert(action != NULL);
|
||||
msre_tfn_metadata *metadata = (msre_tfn_metadata *)action->param_data;
|
||||
action->param_data = metadata;
|
||||
return 1;
|
||||
@@ -804,6 +863,7 @@ static apr_status_t msre_action_t_init(msre_engine *engine, apr_pool_t *mp, msre
|
||||
|
||||
/* ctl */
|
||||
static char *msre_action_ctl_validate(msre_engine *engine, apr_pool_t *mp, msre_action *action) {
|
||||
assert(action != NULL);
|
||||
char *name = NULL;
|
||||
char *value = NULL;
|
||||
|
||||
@@ -1332,6 +1392,7 @@ static apr_status_t msre_action_ctl_execute(modsec_rec *msr, apr_pool_t *mptmp,
|
||||
|
||||
/* xmlns */
|
||||
static char *msre_action_xmlns_validate(msre_engine *engine, apr_pool_t *mp, msre_action *action) {
|
||||
assert(action != NULL);
|
||||
char *name = NULL;
|
||||
char *value = NULL;
|
||||
|
||||
@@ -1392,12 +1453,14 @@ static apr_status_t msre_action_sanitizeMatched_execute(modsec_rec *msr, apr_poo
|
||||
const apr_table_entry_t *telts;
|
||||
int i, type = 0;
|
||||
msc_string *mvar = msr->matched_var;
|
||||
assert(mvar != NULL);
|
||||
|
||||
if (mvar->name_len == 0) return 0;
|
||||
|
||||
/* IMP1 We need to extract the variable name properly here,
|
||||
* taking into account it may have been escaped.
|
||||
*/
|
||||
assert(mvar->name != NULL);
|
||||
if ((mvar->name_len > 5) && (strncmp(mvar->name, "ARGS:", 5) == 0)) {
|
||||
sargname = apr_pstrdup(msr->mp, mvar->name + 5);
|
||||
type = SANITISE_ARG;
|
||||
@@ -1432,10 +1495,13 @@ static apr_status_t msre_action_sanitizeMatched_execute(modsec_rec *msr, apr_poo
|
||||
|
||||
switch(type) {
|
||||
case SANITISE_ARG :
|
||||
assert(msr->arguments_to_sanitize != NULL);
|
||||
tarr = apr_table_elts(msr->arguments);
|
||||
assert(tarr != NULL);
|
||||
telts = (const apr_table_entry_t*)tarr->elts;
|
||||
for (i = 0; i < tarr->nelts; i++) {
|
||||
msc_arg *arg = (msc_arg *)telts[i].val;
|
||||
assert(arg != NULL);
|
||||
if (strcasecmp(sargname, arg->name) == 0) {
|
||||
apr_table_addn(msr->arguments_to_sanitize, arg->name, (void *)arg);
|
||||
}
|
||||
@@ -1443,10 +1509,12 @@ static apr_status_t msre_action_sanitizeMatched_execute(modsec_rec *msr, apr_poo
|
||||
break;
|
||||
|
||||
case SANITISE_REQUEST_HEADER :
|
||||
assert(msr->request_headers_to_sanitize != NULL);
|
||||
apr_table_set(msr->request_headers_to_sanitize, sargname, "1");
|
||||
break;
|
||||
|
||||
case SANITISE_RESPONSE_HEADER :
|
||||
assert(msr->response_headers_to_sanitize != NULL);
|
||||
apr_table_set(msr->response_headers_to_sanitize, sargname, "1");
|
||||
break;
|
||||
|
||||
@@ -1463,7 +1531,9 @@ static apr_status_t msre_action_sanitizeRequestHeader_execute(modsec_rec *msr, a
|
||||
msre_rule *rule, msre_action *action)
|
||||
{
|
||||
assert(msr != NULL);
|
||||
assert(msr->request_headers_to_sanitize != NULL);
|
||||
assert(action != NULL);
|
||||
assert(action->param != NULL);
|
||||
apr_table_set(msr->request_headers_to_sanitize, action->param, "1");
|
||||
return 1;
|
||||
}
|
||||
@@ -1473,7 +1543,9 @@ static apr_status_t msre_action_sanitizeResponseHeader_execute(modsec_rec *msr,
|
||||
msre_rule *rule, msre_action *action)
|
||||
{
|
||||
assert(msr != NULL);
|
||||
assert(msr->response_headers_to_sanitize != NULL);
|
||||
assert(action != NULL);
|
||||
assert(action->param != NULL);
|
||||
apr_table_set(msr->response_headers_to_sanitize, action->param, "1");
|
||||
return 1;
|
||||
}
|
||||
@@ -1484,6 +1556,7 @@ static apr_status_t msre_action_setenv_execute(modsec_rec *msr, apr_pool_t *mptm
|
||||
{
|
||||
assert(msr != NULL);
|
||||
assert(action != NULL);
|
||||
assert(action->param != NULL);
|
||||
char *data = apr_pstrdup(mptmp, action->param);
|
||||
char *env_name = NULL, *env_value = NULL;
|
||||
char *s = NULL;
|
||||
@@ -1501,6 +1574,7 @@ static apr_status_t msre_action_setenv_execute(modsec_rec *msr, apr_pool_t *mptm
|
||||
*s = '\0';
|
||||
}
|
||||
|
||||
assert(msr->txcfg != NULL);
|
||||
if (msr->txcfg->debuglog_level >= 9) {
|
||||
msr_log(msr, 9, "Setting env variable: %s=%s", env_name, env_value);
|
||||
}
|
||||
@@ -1519,6 +1593,7 @@ static apr_status_t msre_action_setenv_execute(modsec_rec *msr, apr_pool_t *mptm
|
||||
/* Execute the requested action. */
|
||||
if (env_name != NULL && env_name[0] == '!') {
|
||||
/* Delete */
|
||||
assert(msr->r != NULL);
|
||||
apr_table_unset(msr->r->subprocess_env, env_name + 1);
|
||||
|
||||
if (msr->txcfg->debuglog_level >= 9) {
|
||||
@@ -1539,6 +1614,7 @@ static apr_status_t msre_action_setenv_execute(modsec_rec *msr, apr_pool_t *mptm
|
||||
expand_macros(msr, val, rule, mptmp);
|
||||
|
||||
/* To be safe, we escape NULs as it goes in subprocess_env. */
|
||||
assert(msr->mp != NULL);
|
||||
val_value = log_escape_nul(msr->mp, (const unsigned char *)val->value, val->value_len);
|
||||
|
||||
apr_table_set(msr->r->subprocess_env, env_name, val_value);
|
||||
@@ -1749,6 +1825,7 @@ static apr_status_t msre_action_setvar_parse(modsec_rec *msr, apr_pool_t *mptmp,
|
||||
{
|
||||
assert(msr != NULL);
|
||||
assert(action != NULL);
|
||||
assert(action->param != NULL);
|
||||
char *data = apr_pstrdup(mptmp, action->param);
|
||||
char *var_name = NULL, *var_value = NULL;
|
||||
char *s = NULL;
|
||||
@@ -1776,6 +1853,7 @@ static apr_status_t msre_action_expirevar_execute(modsec_rec *msr, apr_pool_t *m
|
||||
{
|
||||
assert(msr != NULL);
|
||||
assert(action != NULL);
|
||||
assert(action->param != NULL);
|
||||
char *data = apr_pstrdup(mptmp, action->param);
|
||||
char *col_name = NULL, *var_name = NULL, *var_value = NULL;
|
||||
char *s = NULL;
|
||||
@@ -1875,6 +1953,7 @@ static apr_status_t msre_action_deprecatevar_execute(modsec_rec *msr, apr_pool_t
|
||||
{
|
||||
assert(msr != NULL);
|
||||
assert(action != NULL);
|
||||
assert(action->param != NULL);
|
||||
char *data = apr_pstrdup(mptmp, action->param);
|
||||
char *col_name = NULL, *var_name = NULL, *var_value = NULL;
|
||||
char *s = NULL;
|
||||
@@ -2010,6 +2089,8 @@ static apr_status_t init_collection(modsec_rec *msr, const char *real_col_name,
|
||||
const char *col_name, const char *col_key, unsigned int col_key_len)
|
||||
{
|
||||
assert(msr != NULL);
|
||||
assert(msr->collections != NULL);
|
||||
assert(msr->txcfg != NULL);
|
||||
assert(real_col_name != NULL);
|
||||
apr_table_t *table = NULL;
|
||||
msc_string *var = NULL;
|
||||
@@ -2146,6 +2227,7 @@ static apr_status_t msre_action_initcol_execute(modsec_rec *msr, apr_pool_t *mpt
|
||||
{
|
||||
assert(msr != NULL);
|
||||
assert(action != NULL);
|
||||
assert(action->param != NULL);
|
||||
char *data = apr_pstrdup(msr->mp, action->param);
|
||||
char *col_name = NULL, *col_key = NULL;
|
||||
unsigned int col_key_len;
|
||||
@@ -2179,6 +2261,7 @@ static apr_status_t msre_action_setsid_execute(modsec_rec *msr, apr_pool_t *mptm
|
||||
{
|
||||
assert(msr != NULL);
|
||||
assert(action != NULL);
|
||||
assert(action->param != NULL);
|
||||
msc_string *var = NULL;
|
||||
char *real_col_name = NULL, *col_key = NULL;
|
||||
unsigned int col_key_len;
|
||||
@@ -2205,6 +2288,7 @@ static apr_status_t msre_action_setuid_execute(modsec_rec *msr, apr_pool_t *mptm
|
||||
{
|
||||
assert(msr != NULL);
|
||||
assert(action != NULL);
|
||||
assert(action->param != NULL);
|
||||
msc_string *var = NULL;
|
||||
char *real_col_name = NULL, *col_key = NULL;
|
||||
unsigned int col_key_len;
|
||||
@@ -2231,6 +2315,7 @@ static apr_status_t msre_action_setrsc_execute(modsec_rec *msr, apr_pool_t *mptm
|
||||
{
|
||||
assert(msr != NULL);
|
||||
assert(action != NULL);
|
||||
assert(action->param != NULL);
|
||||
msc_string *var = NULL;
|
||||
char *real_col_name = NULL, *col_key = NULL;
|
||||
unsigned int col_key_len;
|
||||
@@ -2252,6 +2337,8 @@ static apr_status_t msre_action_setrsc_execute(modsec_rec *msr, apr_pool_t *mptm
|
||||
|
||||
/* exec */
|
||||
static char *msre_action_exec_validate(msre_engine *engine, apr_pool_t *mp, msre_action *action) {
|
||||
assert(action != NULL);
|
||||
assert(action->param != NULL);
|
||||
#if defined(WITH_LUA)
|
||||
char *filename = (char *)action->param;
|
||||
|
||||
@@ -2311,6 +2398,7 @@ static apr_status_t msre_action_prepend_execute(modsec_rec *msr, apr_pool_t *mpt
|
||||
{
|
||||
assert(msr != NULL);
|
||||
assert(action != NULL);
|
||||
assert(action->param != NULL);
|
||||
msc_string *var = NULL;
|
||||
|
||||
/* Expand any macros in the text */
|
||||
@@ -2333,6 +2421,7 @@ static apr_status_t msre_action_append_execute(modsec_rec *msr, apr_pool_t *mptm
|
||||
{
|
||||
assert(msr != NULL);
|
||||
assert(action != NULL);
|
||||
assert(action->param != NULL);
|
||||
msc_string *var = NULL;
|
||||
|
||||
/* Expand any macros in the text */
|
||||
|
Reference in New Issue
Block a user