Module: kamailio
Branch: 5.8
Commit: fddfbdcce2587e9b40f6c2fe77334d3b3b1dbb6c
URL: 
https://github.com/kamailio/kamailio/commit/fddfbdcce2587e9b40f6c2fe77334d3b3b1dbb6c

Author: Xenofon Karamanos <x...@gilawa.com>
Committer: Xenofon Karamanos <22965395+xkara...@users.noreply.github.com>
Date: 2025-01-29T11:48:26Z

outbound: Fix flow_token_secret bug

- flow_token_secret is of type str and not char*
- check the length of the string instead of memory for initialization

(cherry picked from commit 046ba41e431fec7fad0c82a9091ea9e27d9f677d)

---

Modified: src/modules/outbound/outbound_mod.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/fddfbdcce2587e9b40f6c2fe77334d3b3b1dbb6c.diff
Patch: 
https://github.com/kamailio/kamailio/commit/fddfbdcce2587e9b40f6c2fe77334d3b3b1dbb6c.patch

---

diff --git a/src/modules/outbound/outbound_mod.c 
b/src/modules/outbound/outbound_mod.c
index 687fc5480d7..2e1251e3ad1 100644
--- a/src/modules/outbound/outbound_mod.c
+++ b/src/modules/outbound/outbound_mod.c
@@ -68,7 +68,7 @@ static cmd_export_t cmds[] = {
 static param_export_t params[] = {
        {"force_outbound_flag", PARAM_INT, &ob_force_flag},
        {"force_no_outbound_flag", PARAM_INT, &ob_force_no_flag},
-       {"flow_token_secret", PARAM_STRING, &flow_token_secret},
+       {"flow_token_secret", PARAM_STR, &flow_token_secret},
        {0, 0, 0}
 };
 
@@ -88,7 +88,7 @@ struct module_exports exports = {
 
 static void mod_init_openssl(void)
 {
-       if(flow_token_secret.s) {
+       if(flow_token_secret.s && flow_token_secret.len > 0) {
                assert(ob_key.len == SHA_DIGEST_LENGTH);
                LM_DBG("flow_token_secret mod param set. use persistent 
ob_key");
 #if OPENSSL_VERSION_NUMBER < 0x030000000L

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to