[Asterisk-code-review] CHAOS: res pjsip diversion avoid crash if allocation fails (asterisk[13])
Richard Mudgett
asteriskteam at digium.com
Thu Sep 17 17:02:04 CDT 2015
Richard Mudgett has uploaded a new change for review.
https://gerrit.asterisk.org/1282
Change subject: CHAOS: res_pjsip_diversion avoid crash if allocation fails
......................................................................
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
---
M res/res_pjsip_diversion.c
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/82/1282/1
diff --git a/res/res_pjsip_diversion.c b/res/res_pjsip_diversion.c
index 49f7892..4d9aca4 100644
--- a/res/res_pjsip_diversion.c
+++ b/res/res_pjsip_diversion.c
@@ -117,7 +117,9 @@
{
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,
--
To view, visit https://gerrit.asterisk.org/1282
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I15d2ed7cb0546818264c0bf251aa40adeae83253
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
More information about the asterisk-code-review
mailing list