Changeset 5191


Ignore:
Timestamp:
Oct 23, 2015 9:50:16 AM (9 years ago)
Author:
nanang
Message:

Misc (re #1882): Only check 'hide' URI parameter on SIP/SIPS URIs in printing route header, otherwise it may cause crash as other URI types may not have 'other_param' field (thanks thanks Fredrik Hansson for the patch).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_msg.c

    r4979 r5191  
    17031703     * if it exists in the route URI. 
    17041704     */ 
    1705     sip_uri = (pjsip_sip_uri*) pjsip_uri_get_uri(hdr->name_addr.uri); 
    1706     p = sip_uri->other_param.next; 
    1707     while (p != &sip_uri->other_param) { 
    1708         const pj_str_t st_hide = {"hide", 4}; 
    1709  
    1710         if (pj_stricmp(&p->name, &st_hide) == 0) { 
    1711             /* Check if param 'hide' is specified without 'lr'. */ 
    1712             pj_assert(sip_uri->lr_param != 0); 
    1713             return 0; 
     1705    if (PJSIP_URI_SCHEME_IS_SIPS(hdr->name_addr.uri) || 
     1706        PJSIP_URI_SCHEME_IS_SIP(hdr->name_addr.uri)) 
     1707    { 
     1708        sip_uri = (pjsip_sip_uri*) pjsip_uri_get_uri(hdr->name_addr.uri); 
     1709        p = sip_uri->other_param.next; 
     1710        while (p != &sip_uri->other_param) { 
     1711            const pj_str_t st_hide = {"hide", 4}; 
     1712 
     1713            if (pj_stricmp(&p->name, &st_hide) == 0) { 
     1714                /* Check if param 'hide' is specified without 'lr'. */ 
     1715                pj_assert(sip_uri->lr_param != 0); 
     1716                return 0; 
     1717            } 
     1718            p = p->next; 
    17141719        } 
    1715         p = p->next; 
    17161720    } 
    17171721 
Note: See TracChangeset for help on using the changeset viewer.