mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
shada: Test that history string does not contain zero byte
This test can safely be ignored for other kinds of strings, but history string contains separator after the last NUL byte and string containing NUL byte inside thus means that separator will be placed at one position, but seeked at another.
This commit is contained in:
parent
c8c5da875c
commit
55712dcdb4
@ -2525,6 +2525,14 @@ shada_read_next_item_start:
|
||||
(uint64_t) initial_fpos);
|
||||
goto shada_read_next_item_error;
|
||||
}
|
||||
if (memchr(unpacked.data.via.array.ptr[1].via.bin.ptr, 0,
|
||||
unpacked.data.via.array.ptr[1].via.bin.size) != NULL) {
|
||||
emsgu("Error while reading ShaDa file: "
|
||||
"history entry at position %" PRIu64 " "
|
||||
"contains string with zero byte inside",
|
||||
(uint64_t) initial_fpos);
|
||||
goto shada_read_next_item_error;
|
||||
}
|
||||
entry->data.history_item.histtype =
|
||||
(uint8_t) unpacked.data.via.array.ptr[0].via.u64;
|
||||
const bool is_hist_search =
|
||||
|
Loading…
Reference in New Issue
Block a user