mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Fix bug in pmf
This commit is contained in:
@@ -1107,6 +1107,9 @@ static int msre_op_pm_param_init(msre_rule *rule, char **error_msg) {
|
|||||||
|
|
||||||
phrase = apr_pstrdup(rule->ruleset->mp, parse_pm_content(rule->op_param, op_len, rule, error_msg));
|
phrase = apr_pstrdup(rule->ruleset->mp, parse_pm_content(rule->op_param, op_len, rule, error_msg));
|
||||||
|
|
||||||
|
if(phrase == NULL)
|
||||||
|
phrase = apr_pstrdup(rule->ruleset->mp, rule->op_param);
|
||||||
|
|
||||||
/* Loop through phrases */
|
/* Loop through phrases */
|
||||||
/* ENH: Need to allow quoted phrases w/space */
|
/* ENH: Need to allow quoted phrases w/space */
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@@ -1202,9 +1205,15 @@ static int msre_op_pmFromFile_param_init(msre_rule *rule, char **error_msg) {
|
|||||||
processed = apr_pstrdup(rule->ruleset->mp, parse_pm_content(buf, op_len, rule, error_msg));
|
processed = apr_pstrdup(rule->ruleset->mp, parse_pm_content(buf, op_len, rule, error_msg));
|
||||||
|
|
||||||
/* Trim Whitespace */
|
/* Trim Whitespace */
|
||||||
|
if(processed != NULL)
|
||||||
start = processed;
|
start = processed;
|
||||||
|
else
|
||||||
|
start = buf;
|
||||||
while ((apr_isspace(*start) != 0) && (*start != '\0')) start++;
|
while ((apr_isspace(*start) != 0) && (*start != '\0')) start++;
|
||||||
|
if(processed != NULL)
|
||||||
end = processed + strlen(processed);
|
end = processed + strlen(processed);
|
||||||
|
else
|
||||||
|
end = buf + strlen(buf);
|
||||||
//end = buf + strlen(buf);
|
//end = buf + strlen(buf);
|
||||||
if (end > start) end--;
|
if (end > start) end--;
|
||||||
while ((end > start) && (apr_isspace(*end) != 0)) end--;
|
while ((end > start) && (apr_isspace(*end) != 0)) end--;
|
||||||
|
Reference in New Issue
Block a user