Module: kamailio
Branch: 5.5
Commit: c4e70496f521a265240736c389716a7dac14893f
URL:
https://github.com/kamailio/kamailio/commit/c4e70496f521a265240736c389716a7…
Author: Henning Westerholt <hw(a)gilawa.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2022-10-17T10:57:01Z
kex: add additional safety checks for printing, based on PR #3250 from bensly-shanmugam
(cherry picked from commit e241f7b8a07b24fba6d6ecf2c344a39d2b2b5859)
---
Modified: src/modules/kex/mod_stats.c
---
Diff:
https://github.com/kamailio/kamailio/commit/c4e70496f521a265240736c389716a7…
Patch:
https://github.com/kamailio/kamailio/commit/c4e70496f521a265240736c389716a7…
---
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) {