mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Fix error message in validateByteRange to include the target variable name. See #157.
This commit is contained in:
@@ -1089,7 +1089,7 @@ static int msre_op_validateByteRange_execute(modsec_rec *msr, msre_rule *rule, m
|
|||||||
int x = ((unsigned char *)var->value)[i];
|
int x = ((unsigned char *)var->value)[i];
|
||||||
if (!(table[x >> 3] & (1 << (x & 0x7)))) {
|
if (!(table[x >> 3] & (1 << (x & 0x7)))) {
|
||||||
if (msr->txcfg->debuglog_level >= 9) {
|
if (msr->txcfg->debuglog_level >= 9) {
|
||||||
msr_log(msr, 9, "Value %i outside range: %s", x, rule->op_param);
|
msr_log(msr, 9, "Value %i in %s outside range: %s", x, var->name, rule->op_param);
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@@ -1097,8 +1097,8 @@ static int msre_op_validateByteRange_execute(modsec_rec *msr, msre_rule *rule, m
|
|||||||
|
|
||||||
if (count == 0) return 0; /* Valid - no match. */
|
if (count == 0) return 0; /* Valid - no match. */
|
||||||
|
|
||||||
*error_msg = apr_psprintf(msr->mp, "Found %i byte(s) outside range: %s.",
|
*error_msg = apr_psprintf(msr->mp, "Found %i byte(s) in %s outside range: %s.",
|
||||||
count, rule->op_param);
|
count, var->name, rule->op_param);
|
||||||
|
|
||||||
return 1; /* Invalid - match.*/
|
return 1; /* Invalid - match.*/
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user