[Asterisk-code-review] res_pjsip_outbound_authenticator_digest: Prevent ABRT on cleanup (asterisk[16])
Joshua Colp
asteriskteam at digium.com
Tue Feb 1 07:39:50 CST 2022
Joshua Colp has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/17946 )
Change subject: res_pjsip_outbound_authenticator_digest: Prevent ABRT on cleanup
......................................................................
res_pjsip_outbound_authenticator_digest: Prevent ABRT on cleanup
In dev mode, if you call pjsip_auth_clt_deinit() with an auth_sess
that hasn't been initialized, it'll assert and abort. If
digest_create_request_with_auth() fails to find the proper
auth object however, it jumps to its cleanup which does exactly
that. So now we no longer attempt to call pjsip_auth_clt_deinit()
if we never actually initialized it.
ASTERISK-29888
Change-Id: Ib6171c25c9fe8e61cc8d11129e324c021bc30b62
---
M res/res_pjsip_outbound_authenticator_digest.c
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
Kevin Harwell: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
diff --git a/res/res_pjsip_outbound_authenticator_digest.c b/res/res_pjsip_outbound_authenticator_digest.c
index b953c8d..39b0e3f 100644
--- a/res/res_pjsip_outbound_authenticator_digest.c
+++ b/res/res_pjsip_outbound_authenticator_digest.c
@@ -560,8 +560,10 @@
cleanup:
#if defined(HAVE_PJSIP_AUTH_CLT_DEINIT)
- /* Release any cached auths */
- pjsip_auth_clt_deinit(&auth_sess);
+ /* If we initialized the auth_sess, clean it up */
+ if (auth_sess.endpt) {
+ pjsip_auth_clt_deinit(&auth_sess);
+ }
#endif
ast_sip_cleanup_auth_objects_vector(&auth_objects_vector);
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/17946
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Ib6171c25c9fe8e61cc8d11129e324c021bc30b62
Gerrit-Change-Number: 17946
Gerrit-PatchSet: 2
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220201/7bb157c6/attachment.html>
More information about the asterisk-code-review
mailing list