summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 82b27acfa..0c515a954 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -13589,6 +13589,13 @@ static int __set_address_from_contact(const char *fullcontact, struct ast_sockad
assume that the domain part is a host name and only look for an A/AAAA record in DNS.
*/
+ /* If we took in an invalid URI, domain may not have been initialized */
+ /* ast_sockaddr_resolve requires an initialized domain string. */
+ if (ast_strlen_zero(domain)) {
+ ast_log(LOG_WARNING, "Invalid URI: parse_uri failed to acquire domain\n");
+ return -1;
+ }
+
if (ast_sockaddr_resolve_first(addr, domain, 0)) {
ast_log(LOG_WARNING, "Invalid host name in Contact: (can't "
"resolve in DNS) : '%s'\n", domain);