From 0b69dbaa216cf5e6b6160da4f990345cf34f37f3 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Mon, 4 Apr 2016 16:32:35 +0200 Subject: [PATCH] account_creator.c: fix crash when user enters a port in domain --- coreapi/account_creator.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/coreapi/account_creator.c b/coreapi/account_creator.c index d1eb954a5..1ea4aabb5 100644 --- a/coreapi/account_creator.c +++ b/coreapi/account_creator.c @@ -170,9 +170,13 @@ static char* _get_identity(const LinphoneAccountCreator *creator) { //we must escape username LinphoneProxyConfig* proxy = linphone_proxy_config_new(); LinphoneAddress* addr; - linphone_proxy_config_set_identity(proxy, "sip:userame@domain.com"); + // creator->domain may contain some port or some transport (eg. toto.org:443;transport=tcp), + // we will accept that + char * tmpidentity = ms_strdup_printf("sip:username@%s", creator->domain); + linphone_proxy_config_set_identity(proxy, tmpidentity); + ms_free(tmpidentity); addr = linphone_proxy_config_normalize_sip_uri(proxy, creator->username); - linphone_address_set_domain(addr, creator->domain); + identity = linphone_address_as_string(addr); linphone_address_destroy(addr); linphone_proxy_config_destroy(proxy);