[Asterisk-code-review] res_pjsip_outbound_authenticator_digest: Prevent ABRT on cleanup (asterisk[18])

George Joseph asteriskteam at digium.com
Tue Feb 1 05:27:24 CST 2022


George Joseph has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/17967 )


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(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/67/17967/1

diff --git a/res/res_pjsip_outbound_authenticator_digest.c b/res/res_pjsip_outbound_authenticator_digest.c
index e6702b4..4821082 100644
--- a/res/res_pjsip_outbound_authenticator_digest.c
+++ b/res/res_pjsip_outbound_authenticator_digest.c
@@ -563,8 +563,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/+/17967
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: Ib6171c25c9fe8e61cc8d11129e324c021bc30b62
Gerrit-Change-Number: 17967
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220201/50fe7963/attachment-0001.html>


More information about the asterisk-code-review mailing list