Skip to content

Commit

Permalink
kex: add additional safety checks for printing, based on PR #3250 fro…
Browse files Browse the repository at this point in the history
…m bensly-shanmugam
  • Loading branch information
henningw committed Sep 21, 2022
1 parent 8064a1d commit e241f7b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/modules/kex/mod_stats.c
Expand Up @@ -86,7 +86,14 @@ static const char* rpc_mod_mem_statsx_doc[2] = {

/* test if the current mod info was already printed */
static int rpc_mod_is_printed_one(mem_counter *stats, mem_counter *current) {
mem_counter *iter = stats;
mem_counter *iter;

if ( stats == NULL || current == NULL )
{
LM_ERR("invalid parameter\n");
return 1;
}
iter = stats;

while (iter && iter != current) {
if (strcmp(iter->mname, current->mname) == 0) {
Expand Down

0 comments on commit e241f7b

Please sign in to comment.