diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-01-07 07:50:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-07 07:50:48 +0800 |
commit | 1c6be5e5e67407d56001826999351806ae655fe5 (patch) | |
tree | 3eb509e1a488ee3e6659da884c753a2b97c0caa2 | |
parent | f7ad46e69ed407579517694ccf3dc1beffe7acdc (diff) | |
download | rneovim-1c6be5e5e67407d56001826999351806ae655fe5.tar.gz rneovim-1c6be5e5e67407d56001826999351806ae655fe5.tar.bz2 rneovim-1c6be5e5e67407d56001826999351806ae655fe5.zip |
fix(coverity/433537): don't call kv_concat_len() when read_size is 0 (#21664)
fix(coverity): don't call kv_concat_len() when read_size is 0
-rw-r--r-- | src/nvim/lua/executor.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 307b34a55c..4ac3c78b0a 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -1738,7 +1738,9 @@ bool nlua_exec_file(const char *path) if (read_size < 0) { // Error. return false; } - kv_concat_len(sb, IObuff, (size_t)read_size); + if (read_size > 0) { + kv_concat_len(sb, IObuff, (size_t)read_size); + } if (read_size < 64) { // EOF. break; } |