Fixed some dereferenced

This commit is contained in:
brenosilva 2012-08-16 18:12:46 +00:00
parent d267142bb5
commit c09d6e57dc

View File

@ -1978,16 +1978,17 @@ static int msre_op_within_execute(modsec_rec *msr, msre_rule *rule, msre_var *va
unsigned int i, i_max; unsigned int i, i_max;
str->value = (char *)rule->op_param; str->value = (char *)rule->op_param;
str->value_len = strlen(str->value);
if (error_msg == NULL) return -1;
*error_msg = NULL;
if (str->value == NULL) { if (str->value == NULL) {
*error_msg = "Internal Error: match string is null."; *error_msg = "Internal Error: match string is null.";
return -1; return -1;
} }
str->value_len = strlen(str->value);
if (error_msg == NULL) return -1;
*error_msg = NULL;
expand_macros(msr, str, rule, msr->mp); expand_macros(msr, str, rule, msr->mp);
match = (const char *)str->value; match = (const char *)str->value;
@ -2047,16 +2048,17 @@ static int msre_op_contains_execute(modsec_rec *msr, msre_rule *rule, msre_var *
unsigned int i, i_max; unsigned int i, i_max;
str->value = (char *)rule->op_param; str->value = (char *)rule->op_param;
str->value_len = strlen(str->value);
if (error_msg == NULL) return -1;
*error_msg = NULL;
if (str->value == NULL) { if (str->value == NULL) {
*error_msg = "Internal Error: match string is null."; *error_msg = "Internal Error: match string is null.";
return -1; return -1;
} }
str->value_len = strlen(str->value);
if (error_msg == NULL) return -1;
*error_msg = NULL;
expand_macros(msr, str, rule, msr->mp); expand_macros(msr, str, rule, msr->mp);
match = (const char *)str->value; match = (const char *)str->value;
@ -2123,16 +2125,17 @@ static int msre_op_containsWord_execute(modsec_rec *msr, msre_rule *rule, msre_v
int rc = 0; int rc = 0;
str->value = (char *)rule->op_param; str->value = (char *)rule->op_param;
str->value_len = strlen(str->value);
if (error_msg == NULL) return -1;
*error_msg = NULL;
if (str->value == NULL) { if (str->value == NULL) {
*error_msg = "Internal Error: match string is null."; *error_msg = "Internal Error: match string is null.";
return -1; return -1;
} }
str->value_len = strlen(str->value);
if (error_msg == NULL) return -1;
*error_msg = NULL;
expand_macros(msr, str, rule, msr->mp); expand_macros(msr, str, rule, msr->mp);
match = (const char *)str->value; match = (const char *)str->value;
@ -2215,16 +2218,17 @@ static int msre_op_streq_execute(modsec_rec *msr, msre_rule *rule, msre_var *var
unsigned int target_length; unsigned int target_length;
str->value = (char *)rule->op_param; str->value = (char *)rule->op_param;
str->value_len = strlen(str->value);
if (error_msg == NULL) return -1;
*error_msg = NULL;
if (str->value == NULL) { if (str->value == NULL) {
*error_msg = "Internal Error: match string is null."; *error_msg = "Internal Error: match string is null.";
return -1; return -1;
} }
str->value_len = strlen(str->value);
if (error_msg == NULL) return -1;
*error_msg = NULL;
expand_macros(msr, str, rule, msr->mp); expand_macros(msr, str, rule, msr->mp);
match = (const char *)str->value; match = (const char *)str->value;
@ -2270,16 +2274,17 @@ static int msre_op_beginsWith_execute(modsec_rec *msr, msre_rule *rule, msre_var
unsigned int target_length; unsigned int target_length;
str->value = (char *)rule->op_param; str->value = (char *)rule->op_param;
str->value_len = strlen(str->value);
if (error_msg == NULL) return -1;
*error_msg = NULL;
if (str->value == NULL) { if (str->value == NULL) {
*error_msg = "Internal Error: match string is null."; *error_msg = "Internal Error: match string is null.";
return -1; return -1;
} }
str->value_len = strlen(str->value);
if (error_msg == NULL) return -1;
*error_msg = NULL;
expand_macros(msr, str, rule, msr->mp); expand_macros(msr, str, rule, msr->mp);
match = (const char *)str->value; match = (const char *)str->value;
@ -2332,16 +2337,17 @@ static int msre_op_endsWith_execute(modsec_rec *msr, msre_rule *rule, msre_var *
unsigned int target_length; unsigned int target_length;
str->value = (char *)rule->op_param; str->value = (char *)rule->op_param;
str->value_len = strlen(str->value);
if (error_msg == NULL) return -1;
*error_msg = NULL;
if (str->value == NULL) { if (str->value == NULL) {
*error_msg = "Internal Error: match string is null."; *error_msg = "Internal Error: match string is null.";
return -1; return -1;
} }
str->value_len = strlen(str->value);
if (error_msg == NULL) return -1;
*error_msg = NULL;
expand_macros(msr, str, rule, msr->mp); expand_macros(msr, str, rule, msr->mp);
match = (const char *)str->value; match = (const char *)str->value;