Module: kamailio
Branch: master
Commit: d4c23324a84d9727653e0b67c4455f9cf6be3d0c
URL:
https://github.com/kamailio/kamailio/commit/d4c23324a84d9727653e0b67c4455f9…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2024-04-18T16:12:33+02:00
cfgutils: initialize the optional key
* bug introduced at 424769743c93dea5a4d2c21f7a0ef8ea8779a5bb
---
Modified: src/modules/cfgutils/cfgutils.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d4c23324a84d9727653e0b67c4455f9…
Patch:
https://github.com/kamailio/kamailio/commit/d4c23324a84d9727653e0b67c4455f9…
---
diff --git a/src/modules/cfgutils/cfgutils.c b/src/modules/cfgutils/cfgutils.c
index f7aea690e88..487f68aaab0 100644
--- a/src/modules/cfgutils/cfgutils.c
+++ b/src/modules/cfgutils/cfgutils.c
@@ -691,7 +691,7 @@ static int cfg_lock_helper(str *lkey, str *lkey2, int mode)
unsigned int pos;
str *key2 = NULL;
- if(lkey2 && lkey2->len > 0) {
+ if(lkey2 && lkey2->s && lkey2->len > 0) {
key2 = lkey2;
}
@@ -770,7 +770,8 @@ static int cfg_trylock_key2(sip_msg_t *msg, str *lkey, str *lkey2)
static int w_cfg_lock_wrapper(
struct sip_msg *msg, gparam_p key, gparam_p key2, int mode)
{
- str s1, s2;
+ str s1;
+ str s2 = STR_NULL;
if(key == NULL) {
return -1;
}