mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
CHAOS: res_pjsip_diversion avoid crash if allocation fails
Validate ast_malloc buffer returned before using it in set_redirecting_value(). ASTERISK-25323 Change-Id: I15d2ed7cb0546818264c0bf251aa40adeae83253
This commit is contained in:
@@ -117,7 +117,9 @@ static void set_redirecting_value(char **dst, const pj_str_t *src)
|
||||
{
|
||||
ast_free(*dst);
|
||||
*dst = ast_malloc(pj_strlen(src) + 1);
|
||||
ast_copy_pj_str(*dst, src, pj_strlen(src) + 1);
|
||||
if (*dst) {
|
||||
ast_copy_pj_str(*dst, src, pj_strlen(src) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void set_redirecting_id(pjsip_name_addr *name_addr, struct ast_party_id *data,
|
||||
|
Reference in New Issue
Block a user