mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2026-01-10 02:04:36 +03:00
Do not use engine->mp for errors. Use pool.
This commit is contained in:
@@ -159,14 +159,14 @@ msre_var *msre_create_var_ex(apr_pool_t *pool, msre_engine *engine, const char *
|
|||||||
/* Resolve variable */
|
/* Resolve variable */
|
||||||
var->metadata = msre_resolve_var(engine, var->name);
|
var->metadata = msre_resolve_var(engine, var->name);
|
||||||
if (var->metadata == NULL) {
|
if (var->metadata == NULL) {
|
||||||
*error_msg = apr_psprintf(engine->mp, "Unknown variable: %s", name);
|
*error_msg = apr_psprintf(pool, "Unknown variable: %s", name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The counting operator "&" can only be used against collections. */
|
/* The counting operator "&" can only be used against collections. */
|
||||||
if (var->is_counting) {
|
if (var->is_counting) {
|
||||||
if (var->metadata->type == VAR_SIMPLE) {
|
if (var->metadata->type == VAR_SIMPLE) {
|
||||||
*error_msg = apr_psprintf(engine->mp, "The & modificator does not apply to "
|
*error_msg = apr_psprintf(pool, "The & modificator does not apply to "
|
||||||
"non-collection variables.");
|
"non-collection variables.");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -175,7 +175,7 @@ msre_var *msre_create_var_ex(apr_pool_t *pool, msre_engine *engine, const char *
|
|||||||
/* Check the parameter. */
|
/* Check the parameter. */
|
||||||
if (param == NULL) {
|
if (param == NULL) {
|
||||||
if (var->metadata->argc_min > 0) {
|
if (var->metadata->argc_min > 0) {
|
||||||
*error_msg = apr_psprintf(engine->mp, "Missing mandatory parameter for variable %s.",
|
*error_msg = apr_psprintf(pool, "Missing mandatory parameter for variable %s.",
|
||||||
name);
|
name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -183,7 +183,7 @@ msre_var *msre_create_var_ex(apr_pool_t *pool, msre_engine *engine, const char *
|
|||||||
|
|
||||||
/* Do we allow a parameter? */
|
/* Do we allow a parameter? */
|
||||||
if (var->metadata->argc_max == 0) {
|
if (var->metadata->argc_max == 0) {
|
||||||
*error_msg = apr_psprintf(engine->mp, "Variable %s does not support parameters.",
|
*error_msg = apr_psprintf(pool, "Variable %s does not support parameters.",
|
||||||
name);
|
name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user