[sr-dev] git:master:6863cb8b: core: early detect of empty host for check_self()

Daniel-Constantin Mierla miconda at gmail.com
Wed Feb 17 14:08:16 CET 2021


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
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;
 	}




More information about the sr-dev mailing list