[Asterisk-code-review] pbx: Prevent Realtime switch crash on invalid priority (...asterisk[master])

Friendly Automation asteriskteam at digium.com
Fri Sep 27 08:29:56 CDT 2019


Friendly Automation has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/12967 )

Change subject: pbx: Prevent Realtime switch crash on invalid priority
......................................................................

pbx: Prevent Realtime switch crash on invalid priority

pbx_extension_helper takes two 'context' arguments. One (con) is a
pointer directly to a 'struct ast_context' and the other (context) is
the name of the context. In all cases, one of these arguments is NULL
and the other is non-NULL.

Functions that are ultimately called by pbx_extension_helper expect that
'context' will be non-NULL, so we set it unconditionally on entry into
this function.

ASTERISK-28534 #close

Change-Id: Ifbbc5e71440afd80efd441f7a9d72e8b10b6f47d
---
M main/pbx.c
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



diff --git a/main/pbx.c b/main/pbx.c
index 83bfb90..8b869f1 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -2884,6 +2884,11 @@
 	int matching_action = (action == E_MATCH || action == E_CANMATCH || action == E_MATCHMORE);
 
 	ast_rdlock_contexts();
+
+	if (!context) {
+		context = con->name;
+	}
+
 	if (found)
 		*found = 0;
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/12967
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ifbbc5e71440afd80efd441f7a9d72e8b10b6f47d
Gerrit-Change-Number: 12967
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190927/7d75054f/attachment.html>


More information about the asterisk-code-review mailing list