Module: kamailio
Branch: master
Commit: e241f7b8a07b24fba6d6ecf2c344a39d2b2b5859
URL:
https://github.com/kamailio/kamailio/commit/e241f7b8a07b24fba6d6ecf2c344a39…
Author: Henning Westerholt <hw(a)gilawa.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2022-09-21T18:34:04Z
kex: add additional safety checks for printing, based on PR #3250 from bensly-shanmugam
---
Modified: src/modules/kex/mod_stats.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e241f7b8a07b24fba6d6ecf2c344a39…
Patch:
https://github.com/kamailio/kamailio/commit/e241f7b8a07b24fba6d6ecf2c344a39…
---
diff --git a/src/modules/kex/mod_stats.c b/src/modules/kex/mod_stats.c
index 25e3285c780..dd73bec522a 100644
--- a/src/modules/kex/mod_stats.c
+++ b/src/modules/kex/mod_stats.c
@@ -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) {