]> 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)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fri, 15 Aug 2025 16:00:25 +0000 (16:00 +0000)
commit5003d882e79991dbf850f17ea3e4428729fe2865
tree8d1d88cc0987311efc72de446a8ef65e05599345
parentd772f61231dad9dc60f576d3c5ef8a7cfd1cb7cb
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
pbx/pbx_lua.c