diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-11-17 09:33:54 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-11-17 09:59:16 +0800 |
commit | 3ab0e296c674a6846512df24a0a70199bba8c59a (patch) | |
tree | 5335d463581b28ce793a8ce0ba7301532980b661 /runtime/lua/vim/snippet.lua | |
parent | 5a67878e8684e02caf853137aae1dc367a77b48f (diff) | |
download | rneovim-3ab0e296c674a6846512df24a0a70199bba8c59a.tar.gz rneovim-3ab0e296c674a6846512df24a0a70199bba8c59a.tar.bz2 rneovim-3ab0e296c674a6846512df24a0a70199bba8c59a.zip |
vim-patch:9.0.1969: [security] buffer-overflow in trunc_string()
Problem: buffer-overflow in trunc_string()
Solution: Add NULL at end of buffer
Currently trunc_string() assumes that when the string is too long,
buf[e-1] will always be writeable. But that assumption may not always be
true. The condition currently looks like this
else if (e + 3 < buflen)
[...]
else
{
// can't fit in the "...", just truncate it
buf[e - 1] = NUL;
}
but this means, we may run into the last else clause with e still being
larger than buflen. So a buffer overflow occurs.
So instead of using `buf[e - 1]`, let's just always
truncate at `buf[buflen - 1]` which should always be writable.
https://github.com/vim/vim/commit/3bd7fa12e146c6051490d048a4acbfba974eeb04
vim-patch:9.0.2004: Missing test file
Problem: Missing test file
Solution: git-add the file to the repo
closes: vim/vim#13305
https://github.com/vim/vim/commit/d4afbdd0715c722cfc73d3a8ab9e578667615faa
Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'runtime/lua/vim/snippet.lua')
0 files changed, 0 insertions, 0 deletions