]> git.ipfire.org Git - thirdparty/asterisk.git/commit
main/pbx: Don't attempt to destroy a previously destroyed exten/priority tuple 55/155/1
authorMatt Jordan <mjordan@digium.com>
Sun, 19 Apr 2015 20:49:43 +0000 (15:49 -0500)
committerMatt Jordan <mjordan@digium.com>
Sun, 19 Apr 2015 21:03:18 +0000 (16:03 -0500)
commitf0c82a173a4dfc78b0f5ebc484a8b905877c95fc
treed7ff8c30d826883f4c0b81f179aece60e89e8483
parente05b0768278a4d697f8b02d1fb81a8c602fc6516
main/pbx: Don't attempt to destroy a previously destroyed exten/priority tuple

When a PBX registrar is unloaded, it will fail to remove its extension from
the context root_table if a dialplan application used by that extension is
still loaded. This can be the case for AGI, which can be unloaded after several
of the standard PBX providers. Often, this is harmless; however, if the
extension's priorities are removed during the failed unloading *and* the
dialplan application later unregisters, it leaves a ticking timebomb for the
next PBX provider that attempts to iterate over the extensions. When that
occurs, the peer_table pointer on the extension will already be set to NULL.
The current code does not check to see if the pointer is NULL before passing
it to a hashtab function this is not NULL tolerant.

Since it is possible for the peer_table to be NULL when we normally would not
expect that to be the case, the solution in this patch is to simply skip over
processing an extension's priorities if peer_table is NULL.

Prior to this patch, the tests/pbx/callerid_match test would crash during
module unload. With this patch, the test no longer crashes after running.

ASTERISK-24774 #close
Reported by: Corey Farrell

Change-Id: I2bbeecb7e0f77bac303a1b9135e4cdb4db6d4c40
main/pbx.c