mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
res_pjsip: Check return from pjsip_parse_uri calls
Updated ast_sip_create_rdata_with_contact and registrar_find_contact to check the return from pjsip_parse_uri before attempting to use the uri returned. ASTERISK-28402 Reported-by: Ross Beer Change-Id: I9810b3b163c45ed5a56ec743586e5ce107f13ba7
This commit is contained in:
@@ -3791,6 +3791,10 @@ int ast_sip_create_rdata_with_contact(pjsip_rx_data *rdata, char *packet, const
|
||||
if (contact_hdr) {
|
||||
contact_hdr->uri = pjsip_parse_uri(rdata->tp_info.pool, (char *)contact,
|
||||
strlen(contact), PJSIP_PARSE_URI_AS_NAMEADDR);
|
||||
if (!contact_hdr->uri) {
|
||||
ast_log(LOG_WARNING, "Unable to parse contact URI from '%s'.\n", contact);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user