aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/luaeval_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-08-27 10:16:59 +0800
committerGitHub <noreply@github.com>2025-08-27 10:16:59 +0800
commit4263ec21c238b2a3da7b1ea711c415827bf63042 (patch)
tree493e5df170da9d1a6205dddf50cd3c90ece24731 /test/functional/lua/luaeval_spec.lua
parentc74192788314cd34b86c9094b62490cfc7aad10e (diff)
downloadrneovim-4263ec21c238b2a3da7b1ea711c415827bf63042.tar.gz
rneovim-4263ec21c238b2a3da7b1ea711c415827bf63042.tar.bz2
rneovim-4263ec21c238b2a3da7b1ea711c415827bf63042.zip
vim-patch:9.1.1688: potential buffer overrun in bufwrite.c (#35497)
Problem: potential buffer overrun in bufwrite.c Solution: Use a temporary variable (John Marriott) In my Windows 11 Pro 64-bit build MAXPATHL is 1024 and IOSIZE is 1025. In my Archlinux Linux 64-bit build MAXPATHL is 4096 and IOSIZE is 1025. In funuction buf_write(): There is a check (line 713) that makes sure the length of fname is less than MAXPATHL. There is a call to STRCPY() (line 1208) which copies the string at fname into IObuff (which has size IOSIZE). For Unix builds fname is set to sfname which may or may not be shorter. However, if sfname is NULL sfname is set to fname. Therefore, in builds where MAXPATHL > IOSIZE (eg in my linux build), it is theoretically possible for the STRCPY() call to exceed the bounds of IObuff. This PR addresses this by copying fname into a local variable that has the same maximum size as fname. In addition: Given that the filename is unconditionally overwritten in the for loop, only copy the directory portion of fname. Move variable i closer to where it is used. closes: vim/vim#18095 https://github.com/vim/vim/commit/a19b019b8745f1c91e42c2b9440bddebfa67a17a Co-authored-by: John Marriott <basilisk@internode.on.net>
Diffstat (limited to 'test/functional/lua/luaeval_spec.lua')
0 files changed, 0 insertions, 0 deletions