mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
Fixed duplicate log entry
use ap_log_error() if msr is NULL Fixed indentation
This commit is contained in:
parent
b53c2277d7
commit
73a79af593
21
apache2/re.c
21
apache2/re.c
@ -297,10 +297,6 @@ char *update_rule_target_ex(modsec_rec *msr, msre_ruleset *ruleset, msre_rule *r
|
|||||||
|
|
||||||
if (value != NULL) value_len = strlen(value);
|
if (value != NULL) value_len = strlen(value);
|
||||||
|
|
||||||
if (msr) {
|
|
||||||
msr_log(msr, 9, "Trying to replace by variable name [%s] value [%s]", name, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
targets = (msre_var **)rule->targets->elts;
|
targets = (msre_var **)rule->targets->elts;
|
||||||
// TODO need a good way to remove the element from array, maybe change array by tables or rings
|
// TODO need a good way to remove the element from array, maybe change array by tables or rings
|
||||||
for (i = 0; i < rule->targets->nelts; i++) {
|
for (i = 0; i < rule->targets->nelts; i++) {
|
||||||
@ -372,10 +368,10 @@ char *update_rule_target_ex(modsec_rec *msr, msre_ruleset *ruleset, msre_rule *r
|
|||||||
else {
|
else {
|
||||||
|
|
||||||
target = strdup(p);
|
target = strdup(p);
|
||||||
if (target == NULL) {
|
if (target == NULL) {
|
||||||
my_error_msg = apr_psprintf(ruleset->mp, "Error to update target - memory allocation");
|
my_error_msg = apr_psprintf(ruleset->mp, "Error to update target - memory allocation");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
is_negated = is_counting = 0;
|
is_negated = is_counting = 0;
|
||||||
param = name = value = NULL;
|
param = name = value = NULL;
|
||||||
@ -491,7 +487,14 @@ char *update_rule_target_ex(modsec_rec *msr, msre_ruleset *ruleset, msre_rule *r
|
|||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (msr && my_error_msg) msr_log(msr, 9, my_error_msg);
|
if (my_error_msg) {
|
||||||
|
if (msr) msr_log(msr, 9, my_error_msg);
|
||||||
|
#if !defined(MSC_TEST)
|
||||||
|
else {
|
||||||
|
ap_log_error(APLOG_MARK, APLOG_INFO, 0, NULL, " ModSecurity: Successfully appended variable");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
if (target_list != NULL) free(target_list);
|
if (target_list != NULL) free(target_list);
|
||||||
if (replace != NULL) free(replace);
|
if (replace != NULL) free(replace);
|
||||||
if (target != NULL) free(target);
|
if (target != NULL) free(target);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user