]> 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)
committerNaveen Albert <asterisk@phreaknet.org>
Thu, 11 Sep 2025 12:31:34 +0000 (12:31 +0000)
commitd9cbadc51b0a17979a34545bb9cd8edeabfadab7
tree7a69ad1341b444e8ac5e694f95abf6730afea637
parent219ec0141c24c466fb9f26714a28e4d82cfd4b18
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