Module: kamailio
Branch: master
Commit: 6863cb8b0253c641146633bd063575a53bc6a466
URL: 
https://github.com/kamailio/kamailio/commit/6863cb8b0253c641146633bd063575a53bc6a466

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2021-02-17T14:07:43+01:00

core: early detect of empty host for check_self()

---

Modified: src/core/forward.c

---

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

---

diff --git a/src/core/forward.c b/src/core/forward.c
index 0ffa627233..57661c211f 100644
--- a/src/core/forward.c
+++ b/src/core/forward.c
@@ -408,6 +408,13 @@ int run_check_self_func(str* host, unsigned short port, 
unsigned short proto)
 int check_self(str* host, unsigned short port, unsigned short proto)
 {
        int ret = 1;
+
+       if(host==NULL || host->s==NULL || host->len<=0) {
+               /* no host (e.g., tel uri) - not matching myself */
+               LM_DBG("no host value - not matching myself addresses\n");
+               return 0;
+       }
+
        if (grep_sock_info(host, port, proto)) {
                goto done;
        }


_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to