[asterisk-commits] pjsip: avoid possible crash req caps allocation failure (asterisk[13])
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Sep 9 17:22:28 CDT 2015
Joshua Colp has submitted this change and it was merged.
Change subject: pjsip: avoid possible crash req_caps allocation failure
......................................................................
pjsip: avoid possible crash req_caps allocation failure
Make certain that the pjsip session has not failed to
allocate the format capabilities structure, which can
otherwise cause a crash when referenced.
ASTERISK-25323
Change-Id: I602790ba12714741165e441cc64a3ecde4cb5750
---
M res/res_pjsip_session.c
1 file changed, 5 insertions(+), 0 deletions(-)
Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Anonymous Coward #1000019: Verified
Joshua Colp: Looks good to me, approved
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 16ed38d..6044ceb 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -1297,6 +1297,11 @@
session->contact = ao2_bump(contact);
session->inv_session = inv_session;
session->req_caps = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
+ if (!session->req_caps) {
+ /* Release the ref held by session->inv_session */
+ ao2_ref(session, -1);
+ return NULL;
+ }
if ((endpoint->dtmf == AST_SIP_DTMF_INBAND) || (endpoint->dtmf == AST_SIP_DTMF_AUTO)) {
dsp_features |= DSP_FEATURE_DIGIT_DETECT;
--
To view, visit https://gerrit.asterisk.org/1215
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I602790ba12714741165e441cc64a3ecde4cb5750
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Scott Griepentrog <sgriepentrog at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Jonathan Rose <jrose at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Scott Griepentrog <sgriepentrog at digium.com>
More information about the asterisk-commits
mailing list