mirror of
https://github.com/neovim/neovim.git
synced 2026-08-27 17:41:48 +00:00
vim-patch:9.2.0219: call stack can be corrupted (#38406)
Problem: call stack can be corrupted, because calculated remaining
capacity for call stack string can underflow (after v9.1.1983)
Solution: Calculate capacity against maximum capacity
(Sergey Vlasov).
closes: vim/vim#19759
8e0483c2f4
Co-authored-by: Sergey Vlasov <sergey@vlasov.me>
This commit is contained in:
@@ -222,7 +222,7 @@ char *estack_sfile(estack_arg_T which)
|
|||||||
// <slnum>. Also leave it out when the number is not set.
|
// <slnum>. Also leave it out when the number is not set.
|
||||||
if (lnum != 0) {
|
if (lnum != 0) {
|
||||||
ga.ga_len += (int)vim_snprintf_safelen((char *)ga.ga_data + ga.ga_len,
|
ga.ga_len += (int)vim_snprintf_safelen((char *)ga.ga_data + ga.ga_len,
|
||||||
len - (size_t)ga.ga_len,
|
(size_t)(ga.ga_maxlen - ga.ga_len),
|
||||||
"[%" PRIdLINENR "]", lnum);
|
"[%" PRIdLINENR "]", lnum);
|
||||||
}
|
}
|
||||||
if (idx != exestack.ga_len - 1) {
|
if (idx != exestack.ga_len - 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user