]> git.ipfire.org Git - thirdparty/asterisk.git/commit
pbx_lua.c: segfault when pass null data to term_color function
authorAlexey Khabulyak <khabalex@gmail.com>
Thu, 14 Aug 2025 08:21:41 +0000 (11:21 +0300)
committerAsterisk Development Team <asteriskteam@digium.com>
Wed, 10 Sep 2025 19:52:59 +0000 (19:52 +0000)
commit2d9a75c68e03e027d26b37a7c8b15177a441e884
treecac3215658765ec631cd83c41e880e7f58afdc9d
parent67007cf6c070ddca49b17a9633c5ae83ded057c5
pbx_lua.c: segfault when pass null data to term_color function

This can be reproduced under certain curcomstences.
For example: call app.playback from lua with invalid data: app.playback({}).
pbx_lua.c will try to get data for this playback using lua_tostring function.
This function returs NULL for everything but strings and numbers.
Then, it calls term_color with NULL data.
term_color function can call(if we don't use vt100 compat term)
ast_copy_string with NULL inbuf which cause segfault. bt example:
ast_copy_string (size=8192, src=0x0, dst=0x7fe44b4be8b0)
at /usr/src/asterisk/asterisk-20.11.0/include/asterisk/strings.h:412

Resolves: https://github.com/asterisk/asterisk/issues/1363
(cherry picked from commit a321038cad901a982e1f9584f9f40f07903450be)
pbx/pbx_lua.c