Skip to content

Commit a01b9b5

Browse files
author
Marc Stern
committed
minor fixes
1 parent 5f93853 commit a01b9b5

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

apache2/apache2_config.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@
3232

3333
// Returns the rule id if existing, otherwise the file name & line number
3434
static const char* id_log(msre_rule* rule) {
35-
const char* id = rule->actionset->id;
36-
if (!id || !*id || id == NOT_SET_P) id = apr_psprintf(rule->ruleset->mp, "%s (%d)", rule->filename, rule->line_num);
35+
char* id = rule->actionset->id;
36+
if (id == NOT_SET_P || !id || !*id)
37+
id = apr_psprintf(rule->ruleset->mp, "%s (%d)", rule->filename, rule->line_num);
3738
return id;
3839
}
3940

apache2/re.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ static int fetch_target_exception(msre_rule *rule, modsec_rec *msr, msre_var *va
168168
* \param p3 Pointer to configuration option REPLACED_TARGET
169169
*/
170170
char *msre_ruleset_rule_update_target_matching_exception(modsec_rec *msr, msre_ruleset *ruleset, rule_exception *re, const char *p2, const char *p3) {
171-
assert(msr != NULL);
172171
char *err;
173172

174173
if(ruleset == NULL)
@@ -210,7 +209,6 @@ char *msre_ruleset_phase_rule_update_target_matching_exception(modsec_rec *msr,
210209
apr_array_header_t *phase_arr, const char *p2,
211210
const char *p3)
212211
{
213-
assert(msr != NULL);
214212
assert(ruleset != NULL);
215213
msre_rule **rules;
216214
int i, j, mode;
@@ -245,7 +243,6 @@ char *msre_ruleset_phase_rule_update_target_matching_exception(modsec_rec *msr,
245243

246244
char *update_rule_target_ex(modsec_rec *msr, msre_ruleset *ruleset, msre_rule *rule, const char *p2,
247245
const char *p3) {
248-
assert(msr != NULL);
249246
assert(ruleset != NULL);
250247

251248
msre_var **targets = NULL;
@@ -646,7 +643,10 @@ static char *msre_generate_target_string(apr_pool_t *pool, msre_rule *rule) {
646643
/**
647644
* Generate an action string from an actionset.
648645
*/
649-
static char *msre_actionset_generate_action_string(apr_pool_t *pool, const msre_actionset *actionset) {
646+
#ifndef DEBUG_CONF
647+
static
648+
#endif
649+
char *msre_actionset_generate_action_string(apr_pool_t *pool, const msre_actionset *actionset) {
650650
const apr_array_header_t *tarr = NULL;
651651
const apr_table_entry_t *telts = NULL;
652652
char *actions = NULL;

apache2/re.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ int DSOLOCAL rule_id_in_range(int ruleid, const char *range);
7575
msre_var DSOLOCAL *generate_single_var(modsec_rec *msr, msre_var *var, apr_array_header_t *tfn_arr,
7676
msre_rule *rule, apr_pool_t *mptmp);
7777

78+
#ifdef DEBUG_CONF
79+
char DSOLOCAL* msre_actionset_generate_action_string(apr_pool_t* pool, const msre_actionset* actionset);
80+
#endif
81+
7882
#if defined(WITH_LUA)
7983
apr_table_t DSOLOCAL *generate_multi_var(modsec_rec *msr, msre_var *var, apr_array_header_t *tfn_arr,
8084
msre_rule *rule, apr_pool_t *mptmp);

0 commit comments

Comments
 (0)