]> 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:17 +0000 (16:00 +0000)
commitb098f2aa0f2d8fff434a317bd6e1cfd028cee95f
tree979c7fffe417c55920cd85ba3ed396a45e9a1e8d
parenta23c467c829f937fdccb45fcb907153f7aa7b275
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