]> git.ipfire.org Git - thirdparty/asterisk.git/commit
pbx_variables.c: Create real channel for "dialplan eval function".
authorNaveen Albert <asterisk@phreaknet.org>
Tue, 9 Sep 2025 20:10:14 +0000 (16:10 -0400)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Thu, 11 Sep 2025 12:31:43 +0000 (12:31 +0000)
commit971beef41c32c301cf843a5b9993affd036af27c
tree878ca66d7f2d41a92a1beb468986be9117dc5eed
parent0deac782db0c4fe58c59d61f802212e78ee1162e
pbx_variables.c: Create real channel for "dialplan eval function".

"dialplan eval function" has been using a dummy channel for function
evaluation, much like many of the unit tests. However, sometimes, this
can cause issues for functions that are not expecting dummy channels.
As an example, ast_channel_tech(chan) is NULL on such channels, and
ast_channel_tech(chan)->type consequently results in a NULL dereference.
Normally, functions do not worry about this since channels executing
dialplan aren't dummy channels.

While some functions are better about checking for these sorts of edge
cases, use a real channel with a dummy technology to make this CLI
command inherently safe for any dialplan function that could be evaluated
from the CLI.

Resolves: #1434
main/pbx_variables.c