mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 18:06:30 +00:00
Avoid serializing NULL string through msgpack
Attempting to serialize a NULL string through msgpack results in msgpack_sbuffer_write attempting to memcpy from a NULL pointer, which is undefined behavior.
This commit is contained in:
@@ -1575,7 +1575,9 @@ static char *shada_filename(const char *file)
|
||||
do { \
|
||||
const String s_ = (s); \
|
||||
msgpack_pack_bin(spacker, s_.size); \
|
||||
msgpack_pack_bin_body(spacker, s_.data, s_.size); \
|
||||
if (s_.size > 0) { \
|
||||
msgpack_pack_bin_body(spacker, s_.data, s_.size); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/// Write single ShaDa entry
|
||||
|
Reference in New Issue
Block a user