[sr-dev] git:5.4:5b6a7722: core: early detect of empty host for check_self()

Daniel-Constantin Mierla miconda at gmail.com
Mon Mar 1 18:32:38 CET 2021


Module: kamailio
Branch: 5.4
Commit: 5b6a77222eca4e927480ed7b18e7f233e3fdf822
URL: https://github.com/kamailio/kamailio/commit/5b6a77222eca4e927480ed7b18e7f233e3fdf822

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-03-01T18:30:47+01:00

core: early detect of empty host for check_self()

(cherry picked from commit 6863cb8b0253c641146633bd063575a53bc6a466)

---

Modified: src/core/forward.c

---

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

---

diff --git a/src/core/forward.c b/src/core/forward.c
index 716b148f2c..a7f6c06bfc 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