another null check

This commit is contained in:
Marc Stern 2024-04-16 18:02:06 +02:00
parent 5122f89005
commit d35018ef3f

View File

@ -32,7 +32,9 @@
// Returns the rule id if existing, otherwise the file name & line number // Returns the rule id if existing, otherwise the file name & line number
const char* id_log(msre_rule* rule) { const char* id_log(msre_rule* rule) {
char* id = rule->actionset->id; assert(rule != NULL);
assert(rule->actionset != NULL);
char* id = rule->actionset->id;
if (!id || !*id || id == NOT_SET_P) id = apr_psprintf(rule->ruleset->mp, "%s (%d)", rule->filename, rule->line_num); if (!id || !*id || id == NOT_SET_P) id = apr_psprintf(rule->ruleset->mp, "%s (%d)", rule->filename, rule->line_num);
return id; return id;
} }