From d4c23324a84d9727653e0b67c4455f9cf6be3d0c Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Thu, 18 Apr 2024 15:29:39 +0200 Subject: [PATCH] cfgutils: initialize the optional key * bug introduced at 424769743c93dea5a4d2c21f7a0ef8ea8779a5bb --- src/modules/cfgutils/cfgutils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; }