diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-11-11 10:21:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-11 10:21:14 +0800 |
commit | e9b9a86cd5a555943b87f0ba40c4527561c3c124 (patch) | |
tree | b1f2aef3e5e68053a8d2f08206b2c61083e6f6c1 /src/nvim/api/private | |
parent | d1b2a5cf5fa583b556457d34a46ce7b940913a66 (diff) | |
download | rneovim-e9b9a86cd5a555943b87f0ba40c4527561c3c124.tar.gz rneovim-e9b9a86cd5a555943b87f0ba40c4527561c3c124.tar.bz2 rneovim-e9b9a86cd5a555943b87f0ba40c4527561c3c124.zip |
fix(context): don't crash on invalid arg to nvim_get_context (#25977)
Note: The crash happens in the second test case when using uninitialized
memory, and therefore doesn't happen with ASAN.
Diffstat (limited to 'src/nvim/api/private')
-rw-r--r-- | src/nvim/api/private/converter.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/api/private/converter.c b/src/nvim/api/private/converter.c index 10152cb3c8..d9832abd76 100644 --- a/src/nvim/api/private/converter.c +++ b/src/nvim/api/private/converter.c @@ -261,7 +261,9 @@ Object vim_to_object(typval_T *obj) /// @param obj Object to convert from. /// @param tv Conversion result is placed here. On failure member v_type is /// set to VAR_UNKNOWN (no allocation was made for this variable). -/// returns true if conversion is successful, otherwise false. +/// @param err Error object. +/// +/// @returns true if conversion is successful, otherwise false. bool object_to_vim(Object obj, typval_T *tv, Error *err) { tv->v_type = VAR_UNKNOWN; |