Skip to content

Commit

Permalink
[core] do not use LM_xxx if log_level is NULL
Browse files Browse the repository at this point in the history
This may never happen, but as LM_xxx is testing the log_level value, it is not wise to use it to report that log_level is NULL

Reported by coverity CID 207925
  • Loading branch information
bogdan-iancu committed Jul 15, 2020
1 parent f564faa commit e43b6e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,8 @@ static int w_script_trace(struct sip_msg *msg, int *log_level,
use_script_trace = 0;
return 1;
} else if (!log_level) {
LM_ERR("Missing 'log_level' parameter\n");
// this should not happen, it's just a super precaution
// and no LM_xxx here, as it assumes a valid log_level
return E_CFG;
} else if (!fmt_string) {
LM_ERR("Missing 'pv_format_string' parameter\n");
Expand Down

0 comments on commit e43b6e5

Please sign in to comment.