mirror of
https://github.com/neovim/neovim.git
synced 2026-01-19 19:37:02 +00:00
Problem:
Calling `xstrdup` with a NULL pointer causes a SIGSEGV if `lua_tostring` returns
NULL in `nlua_luv_thread_common_cfpcall`.
Crash stack trace:
- `_platform_strlen` → `xstrdup` (memory.c:469)
- `nlua_luv_thread_common_cfpcall` (executor.c:281)
Solution:
Check if `lua_tostring` returns NULL and pass NULL to `event_create` to avoid the crash.
(cherry picked from commit a5b1b83a26)
Co-authored-by: 林玮 (Jade Lin) <linw1995@icloud.com>