]> 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 20:18:53 +0000 (20:18 +0000)
commit7d04ff2878a2e16a6c3aca9d192f0d7febf6afdf
tree979c7fffe417c55920cd85ba3ed396a45e9a1e8d
parent2612ba32fc943a5459ebfa1344282a7146f4940b
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 b098f2aa0f2d8fff434a317bd6e1cfd028cee95f)
pbx/pbx_lua.c