- Timestamp:
- Jun 2, 2010 3:03:43 AM (14 years ago)
- Location:
- pjproject/trunk/pjsip/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r3094 r3190 751 751 pjsip_supported_hdr *sup_hdr; 752 752 pjsip_require_hdr *req_hdr; 753 pjsip_contact_hdr *c_hdr; 753 754 int code = 200; 754 755 unsigned rem_option = 0; … … 784 785 /* Init response header list */ 785 786 pj_list_init(&res_hdr_list); 787 788 /* Check the Contact header */ 789 c_hdr = (pjsip_contact_hdr*) 790 pjsip_msg_find_hdr(msg, PJSIP_H_CONTACT, NULL); 791 if (!c_hdr || !c_hdr->uri) { 792 /* Missing Contact header or Contact contains "*" */ 793 pjsip_warning_hdr *w; 794 pj_str_t warn_text; 795 796 warn_text = pj_str("Bad/missing Contact header"); 797 w = pjsip_warning_hdr_create(rdata->tp_info.pool, 399, 798 pjsip_endpt_name(endpt), 799 &warn_text); 800 if (w) { 801 pj_list_push_back(&res_hdr_list, w); 802 } 803 804 code = PJSIP_SC_BAD_REQUEST; 805 status = PJSIP_ERRNO_FROM_SIP_STATUS(code); 806 goto on_return; 807 } 786 808 787 809 /* Check the request body, see if it's something that we support, -
pjproject/trunk/pjsip/src/pjsip/sip_dialog.c
r3068 r3190 433 433 pos); 434 434 if (contact_hdr) { 435 if (!PJSIP_URI_SCHEME_IS_SIP(contact_hdr->uri) && 436 !PJSIP_URI_SCHEME_IS_SIPS(contact_hdr->uri)) 435 if (!contact_hdr->uri || 436 (!PJSIP_URI_SCHEME_IS_SIP(contact_hdr->uri) && 437 !PJSIP_URI_SCHEME_IS_SIPS(contact_hdr->uri))) 437 438 { 438 439 pos = (pjsip_hdr*)contact_hdr->next; … … 612 613 contact = (const pjsip_contact_hdr*) 613 614 pjsip_msg_find_hdr(msg, PJSIP_H_CONTACT, NULL); 614 if (contact == NULL )615 if (contact == NULL || contact->uri == NULL) 615 616 return PJSIP_EMISSINGHDR; 616 617 … … 1502 1503 1503 1504 1504 /* This function is called by user agent upon receiving incoming re sponse1505 /* This function is called by user agent upon receiving incoming request 1505 1506 * message. 1506 1507 */ … … 1589 1590 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 1590 1591 NULL); 1591 if (contact && (dlg->remote.contact==NULL || 1592 pjsip_uri_cmp(PJSIP_URI_IN_REQ_URI, 1593 dlg->remote.contact->uri, 1594 contact->uri))) 1592 if (contact && contact->uri && 1593 (dlg->remote.contact==NULL || 1594 pjsip_uri_cmp(PJSIP_URI_IN_REQ_URI, 1595 dlg->remote.contact->uri, 1596 contact->uri))) 1595 1597 { 1596 1598 dlg->remote.contact = (pjsip_contact_hdr*) … … 1794 1796 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 1795 1797 NULL); 1796 if (contact && (dlg->remote.contact==NULL || 1797 pjsip_uri_cmp(PJSIP_URI_IN_REQ_URI, 1798 dlg->remote.contact->uri, 1799 contact->uri))) 1798 if (contact && contact->uri && 1799 (dlg->remote.contact==NULL || 1800 pjsip_uri_cmp(PJSIP_URI_IN_REQ_URI, 1801 dlg->remote.contact->uri, 1802 contact->uri))) 1800 1803 { 1801 1804 dlg->remote.contact = (pjsip_contact_hdr*) … … 1844 1847 PJSIP_H_CONTACT, 1845 1848 NULL); 1846 if (contact && (dlg->remote.contact==NULL || 1847 pjsip_uri_cmp(PJSIP_URI_IN_REQ_URI, 1848 dlg->remote.contact->uri, 1849 contact->uri))) 1849 if (contact && contact->uri && 1850 (dlg->remote.contact==NULL || 1851 pjsip_uri_cmp(PJSIP_URI_IN_REQ_URI, 1852 dlg->remote.contact->uri, 1853 contact->uri))) 1850 1854 { 1851 1855 dlg->remote.contact = (pjsip_contact_hdr*) -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r3185 r3190 2238 2238 pos); 2239 2239 if (h_contact) { 2240 uri = (pjsip_uri*) pjsip_uri_get_uri(h_contact->uri); 2241 if (!PJSIP_URI_SCHEME_IS_SIP(uri) && 2242 !PJSIP_URI_SCHEME_IS_SIPS(uri)) 2240 if (h_contact->uri) 2241 uri = (pjsip_uri*) pjsip_uri_get_uri(h_contact->uri); 2242 else 2243 uri = NULL; 2244 if (!uri || (!PJSIP_URI_SCHEME_IS_SIP(uri) && 2245 !PJSIP_URI_SCHEME_IS_SIPS(uri))) 2243 2246 { 2244 2247 pos = (pjsip_hdr*)h_contact->next; -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_im.c
r2923 r3190 170 170 pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, 171 171 NULL); 172 if (contact_hdr ) {172 if (contact_hdr && contact_hdr->uri) { 173 173 contact.ptr = (char*) pj_pool_alloc(rdata->tp_info.pool, 174 174 PJSIP_MAX_URL_SIZE); -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
r3096 r3190 1611 1611 pjsip_msg_find_hdr(event->body.rx_msg.rdata->msg_info.msg, 1612 1612 PJSIP_H_CONTACT, NULL); 1613 if (!contact_hdr ) {1613 if (!contact_hdr || !contact_hdr->uri) { 1614 1614 return; 1615 1615 }
Note: See TracChangeset
for help on using the changeset viewer.