From a0352e56f1e08f35f9f956bc4778b78e1cb2ab3c Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 1 Dec 2014 10:46:30 +0100 Subject: [PATCH] make sure username is not empty before trying to marshal it --- src/belle_sip_uri_impl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/belle_sip_uri_impl.c b/src/belle_sip_uri_impl.c index 52ef7a2c..4d1a4bd0 100644 --- a/src/belle_sip_uri_impl.c +++ b/src/belle_sip_uri_impl.c @@ -95,7 +95,7 @@ belle_sip_error_code belle_sip_uri_marshal(const belle_sip_uri_t* uri, char* buf error=belle_sip_snprintf(buff,buff_size,offset,"%s:",uri->secure?"sips":"sip"); if (error!=BELLE_SIP_OK) return error; - if (uri->user) { + if (uri->user && uri->user[0]!='\0') { char* escaped_username=belle_sip_uri_to_escaped_username(uri->user); error=belle_sip_snprintf(buff,buff_size,offset,"%s",escaped_username); belle_sip_free(escaped_username); -- GitLab