Module: kamailio
Branch: master
Commit: b32a9caf4797370a4704b5f94d2d704b6e52fdef
URL:
https://github.com/kamailio/kamailio/commit/b32a9caf4797370a4704b5f94d2d704…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-03-16T10:11:43+01:00
core: parse uri - extra check when user part is missing before @
---
Modified: src/core/parser/parse_uri.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b32a9caf4797370a4704b5f94d2d704…
Patch:
https://github.com/kamailio/kamailio/commit/b32a9caf4797370a4704b5f94d2d704…
---
diff --git a/src/core/parser/parse_uri.c b/src/core/parser/parse_uri.c
index edc46acea1..adc94fbc0a 100644
--- a/src/core/parser/parse_uri.c
+++ b/src/core/parser/parse_uri.c
@@ -1241,14 +1241,15 @@ int parse_uri(char* buf, int len, struct sip_uri* uri)
/* port value too large */
goto error_invalid_port;
}
- if(uri->host.len>0 && uri->host.s>buf &&
*(uri->host.s-1)=='@'
- && uri->user.len<=0) {
+ if(uri->host.len>0 && uri->user.len<=0
&&uri->host.s>buf && (*(uri->host.s-1)=='@'
+ || *uri->host.s=='@')) {
/* '@' before host, but no user part */
goto error_bad_uri;
}
#ifdef EXTRA_DEBUG
/* do stuff */
+ LM_DBG("state=%d\n", state);
LM_DBG("parsed uri:\n type=%d user=<%.*s>(%d)\n
passwd=<%.*s>(%d)\n"
" host=<%.*s>(%d)\n port=<%.*s>(%d): %d\n
params=<%.*s>(%d)\n"
" headers=<%.*s>(%d)\n",