summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/_core/stringbuffer.lua
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2025-12-21 23:59:28 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2025-12-22 00:17:09 -0500
commit1afdcb8f2b3b63e241adecc0e0d5aad98d3640ea (patch)
tree373da4a4bb62f910a51d77bdc8c948922937de91 /runtime/lua/vim/_core/stringbuffer.lua
parentefacb107092602d4458623811a331c821ae9d49e (diff)
vim-patch:9.0.1899: potential buffer overflow in PBYTE macro
Problem: potential buffer overflow in PBYTE macro Solution: Check returned memline length closes: vim/vim#13083 the PBYTE macro is used to put byte c at a position lp of the returned memline. However, in case of unexpected errors ml_get_buf() may return either "???" or an empty line in which case it is quite likely that we are causing a buffer overrun. Therefore, switch the macro PBYTE (which is only used in ops.c anyhow) to a function, that verifies that we will only try to access within the given length of the buffer. Also, since the macro is only used in ops.c, move the definition from macros.h to ops.c https://github.com/vim/vim/commit/ffb13674d1af1c90beb229867ec989e4fb232df3 Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'runtime/lua/vim/_core/stringbuffer.lua')
0 files changed, 0 insertions, 0 deletions