Related to ticket #97: make name_addr handling more robust against possibility of bugs that someone may put another name_addr inside a name_addr
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@939 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
parent
c2daf784d5
commit
9c1528fadb
|
@ -203,7 +203,7 @@ static void *pjsip_get_uri( pjsip_uri *uri )
|
|||
|
||||
static void *pjsip_name_addr_get_uri( pjsip_name_addr *name )
|
||||
{
|
||||
return name->uri;
|
||||
return pjsip_uri_get_uri(name->uri);
|
||||
}
|
||||
|
||||
PJ_DEF(void) pjsip_sip_uri_set_secure( pjsip_sip_uri *url,
|
||||
|
@ -529,8 +529,10 @@ static pj_ssize_t pjsip_name_addr_print(pjsip_uri_context_e context,
|
|||
int printed;
|
||||
char *startbuf = buf;
|
||||
char *endbuf = buf + size;
|
||||
pjsip_uri *uri;
|
||||
|
||||
pj_assert(name->uri != NULL);
|
||||
uri = pjsip_uri_get_uri(name->uri);
|
||||
pj_assert(uri != NULL);
|
||||
|
||||
if (context != PJSIP_URI_IN_REQ_URI) {
|
||||
if (name->display.slen) {
|
||||
|
@ -543,7 +545,7 @@ static pj_ssize_t pjsip_name_addr_print(pjsip_uri_context_e context,
|
|||
*buf++ = '<';
|
||||
}
|
||||
|
||||
printed = pjsip_uri_print(context,name->uri, buf, size-(buf-startbuf));
|
||||
printed = pjsip_uri_print(context,uri, buf, size-(buf-startbuf));
|
||||
if (printed < 1)
|
||||
return -1;
|
||||
buf += printed;
|
||||
|
|
|
@ -943,7 +943,8 @@ PJ_DEF(pj_status_t) pjsua_acc_create_uac_contact( pj_pool_t *pool,
|
|||
* first entry of the route-set.
|
||||
*/
|
||||
if (!pj_list_empty(&acc->route_set)) {
|
||||
sip_uri = (pjsip_sip_uri*) acc->route_set.next->name_addr.uri;
|
||||
sip_uri = (pjsip_sip_uri*)
|
||||
pjsip_uri_get_uri(acc->route_set.next->name_addr.uri);
|
||||
} else {
|
||||
pj_str_t tmp;
|
||||
pjsip_uri *uri;
|
||||
|
@ -1034,7 +1035,8 @@ PJ_DEF(pj_status_t) pjsua_acc_create_uas_contact( pj_pool_t *pool,
|
|||
|
||||
/* If Record-Route is present, then URI is the top Record-Route. */
|
||||
if (rdata->msg_info.record_route) {
|
||||
sip_uri = (pjsip_sip_uri*) rdata->msg_info.record_route->name_addr.uri;
|
||||
sip_uri = (pjsip_sip_uri*)
|
||||
pjsip_uri_get_uri(rdata->msg_info.record_route->name_addr.uri);
|
||||
} else {
|
||||
pjsip_contact_hdr *h_contact;
|
||||
pjsip_uri *uri = NULL;
|
||||
|
|
|
@ -185,7 +185,7 @@ PJ_DEF(pj_status_t) pjsua_buddy_add( const pjsua_buddy_config *cfg,
|
|||
/* Save URI */
|
||||
pjsua_var.buddy[index].uri = tmp;
|
||||
|
||||
sip_uri = (pjsip_sip_uri*) url->uri;
|
||||
sip_uri = (pjsip_sip_uri*) pjsip_uri_get_uri(url->uri);
|
||||
pjsua_var.buddy[index].name = sip_uri->user;
|
||||
pjsua_var.buddy[index].display = url->display;
|
||||
pjsua_var.buddy[index].host = sip_uri->host;
|
||||
|
|
Loading…
Reference in New Issue