mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
shada: Fix out-of-bounds array access
It leads to a memory leak as well. May overwrite wms->jumps_size.
This commit is contained in:
@@ -1209,8 +1209,11 @@ static inline bool marks_equal(const pos_T a, const pos_T b)
|
||||
if (i > 0) { \
|
||||
if (jl_len == JUMPLISTSIZE) { \
|
||||
free_func(jumps[0]); \
|
||||
if (i == JUMPLISTSIZE) { \
|
||||
i = JUMPLISTSIZE - 1; \
|
||||
} \
|
||||
memmove(&jumps[0], &jumps[1], sizeof(jumps[1]) * (size_t) i); \
|
||||
} else { \
|
||||
} else if (i != jl_len) { \
|
||||
memmove(&jumps[i + 1], &jumps[i], \
|
||||
sizeof(jumps[0]) * (size_t) (jl_len - i)); \
|
||||
} \
|
||||
|
Reference in New Issue
Block a user