ModSecurity
ModSecurity copied to clipboard
NULL pointer
In modsec_var_log_handler(), ther's a check for msr being NULL: if (msr == NULL) return NULL; return construct_single_var(msr, name);
construct_single_var() uses msr->msc_rule_mptmp, so this should also be checked: if (msr->msc_rule_mptmp == NULL) return NULL;
Actually, it would maybe be safer to perform the checks in construct_single_var():
if (!msr || !msr->mp || !msr->modsecurity) return NULL;
We should also check msr->modsecurity->msre & msr->msc_rule_mptmp, either in construct_single_var() or, better, in the functions they're used: msre_resolve_var() & generate_single_var()