diff options
Diffstat (limited to 'res/res_pjsip.c')
-rw-r--r-- | res/res_pjsip.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c index 1fce19b8a..842cc20e3 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -2573,13 +2573,13 @@ int ast_sip_register_endpoint_identifier_with_name(struct ast_sip_endpoint_ident id_list_item = ast_calloc(1, sizeof(*id_list_item)); if (!id_list_item) { - ast_log(LOG_ERROR, "Unabled to add endpoint identifier. Out of memory.\n"); + ast_log(LOG_ERROR, "Unable to add endpoint identifier. Out of memory.\n"); return -1; } id_list_item->identifier = identifier; id_list_item->name = name; - ast_debug(1, "Register endpoint identifier %s (%p)\n", name, identifier); + ast_debug(1, "Register endpoint identifier %s(%p)\n", name ?: "", identifier); if (ast_strlen_zero(name)) { /* if an identifier has no name then place in front */ @@ -2602,7 +2602,8 @@ int ast_sip_register_endpoint_identifier_with_name(struct ast_sip_endpoint_ident id_list_item->priority = 0; while ((current = strchr(current, ','))) { ++id_list_item->priority; - if (!strncmp(prev, name, current - prev)) { + if (!strncmp(prev, name, current - prev) + && strlen(name) == current - prev) { break; } prev = ++current; @@ -3241,7 +3242,7 @@ pjsip_dialog *ast_sip_create_dialog_uas(const struct ast_sip_endpoint *endpoint, ast_assert(status != NULL); contact_hdr = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT, NULL); - if (ast_sip_set_tpselector_from_ep_or_uri(endpoint, pjsip_uri_get_uri(contact_hdr->uri), + if (!contact_hdr || ast_sip_set_tpselector_from_ep_or_uri(endpoint, pjsip_uri_get_uri(contact_hdr->uri), &selector)) { return NULL; } |