Skip to content

Commit

Permalink
core: early detect of empty host for check_self()
Browse files Browse the repository at this point in the history
(cherry picked from commit 6863cb8)
(cherry picked from commit 5b6a772)
  • Loading branch information
miconda committed Mar 29, 2021
1 parent f78d112 commit 5568945
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/forward.c
Expand Up @@ -407,6 +407,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;
}
Expand Down

0 comments on commit 5568945

Please sign in to comment.