[Asterisk-code-review] pbx.c: Prevent infinite recursion in manager show dialplan h... (asterisk[master])

Etienne Lessard asteriskteam at digium.com
Mon Aug 29 07:25:45 CDT 2016


Etienne Lessard has posted comments on this change.

Change subject: pbx.c: Prevent infinite recursion in manager_show_dialplan_helper.
......................................................................


Patch Set 1:

Note that although the code does fix the crash, it doesn't produce the totally right result in the following scenario:

    Given context A includes context B, and defines an extension 100
    Given context B includes context A
    Then the output of "ShowDialplan" for extension 100 in context A shows the extension 100 at A 2 times (expected: 1 time)

The problem is that the context A is visited twice in this scenario, because it is not added to the array the first time it is visited. The same bug exist in the show_dialplan_helper function (of course). And there's similar issue if, for example, you have A -> B -> D and A -> C -> D: if extension 100 is defined in context D, it will be shown twice (and note that in this case there's no circular dependencies). The solution would be to make sure each context is visited at most 1 time. If there's interest, I guess I could propose a fix for this problem in another change.

-- 
To view, visit https://gerrit.asterisk.org/3751
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1aea85133c21787226f4f8442253a93000aa0897
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Etienne Lessard <elessard at proformatique.com>
Gerrit-Reviewer: Etienne Lessard <elessard at proformatique.com>
Gerrit-HasComments: No



More information about the asterisk-code-review mailing list