Skip to content

Commit

Permalink
[core] fix parse_uri() parsing
Browse files Browse the repository at this point in the history
Issue discovered during OpenSIPS Security Audit 2022,
	by Alfred Farrugia & Sandro Gauci (Enable Security)

GHSA-358f-935m-7p9c
  • Loading branch information
bogdan-iancu committed Feb 23, 2022
1 parent 35dfd3a commit b2dffe4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions parser/parse_uri.c
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,8 @@ int parse_uri(char* buf, int len, struct sip_uri* uri)
case TELS_URI_T:
/* fix tel uris, move the number in uri and empty the host */
uri->user=uri->host;
uri->host.s="";
/* TEL does not have a host part, still most of the code expects
* one, so lets keep the pointer, but set a 0 length */
uri->host.len=0;
break;
case SIP_URI_T:
Expand All @@ -1543,8 +1544,7 @@ int parse_uri(char* buf, int len, struct sip_uri* uri)
case URN_NENA_SERVICE_URI_T:
uri->user.s=0;
uri->user.len=0;
uri->host.s="";
uri->host.len=0;
/* keep the service name as host part */
break;
case ERROR_URI_T:
LM_ERR("unexpected error (BUG?)\n");
Expand Down

0 comments on commit b2dffe4

Please sign in to comment.