Browse code

core: early detect of empty host for check_self()

Daniel-Constantin Mierla authored on 17/02/2021 13:07:43
Showing 1 changed files
... ...
@@ -408,6 +408,13 @@ int run_check_self_func(str* host, unsigned short port, unsigned short proto)
408 408
 int check_self(str* host, unsigned short port, unsigned short proto)
409 409
 {
410 410
 	int ret = 1;
411
+
412
+	if(host==NULL || host->s==NULL || host->len<=0) {
413
+		/* no host (e.g., tel uri) - not matching myself */
414
+		LM_DBG("no host value - not matching myself addresses\n");
415
+		return 0;
416
+	}
417
+
411 418
 	if (grep_sock_info(host, port, proto)) {
412 419
 		goto done;
413 420
 	}