]> 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)
committerAlexey Khabulyak <khabalex@gmail.com>
Fri, 15 Aug 2025 16:00:16 +0000 (16:00 +0000)
commita321038cad901a982e1f9584f9f40f07903450be
treed19bb19ce50d579936ba78ed038c16b08ed34037
parent3ea3ec6f0aaebe7bc057bab584f11ef0e7171514
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