diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2026-06-12 19:37:44 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-12 19:37:44 +0800 |
| commit | 76cacf6f8bb710e4bdeafd61dd6745d79baa6c71 (patch) | |
| tree | 4ef7b8155f9d57b5b6f0c2147014b72fa28d59d6 /test/functional/vimscript/executable_spec.lua | |
| parent | 6f68c872d6395c45862947ce7b95dff093452991 (diff) | |
| download | rneovim-76cacf6f8bb710e4bdeafd61dd6745d79baa6c71.tar.gz rneovim-76cacf6f8bb710e4bdeafd61dd6745d79baa6c71.tar.bz2 rneovim-76cacf6f8bb710e4bdeafd61dd6745d79baa6c71.zip | |
vim-patch:9.2.0623: possible integer overflow in spellfile tree bounds check (#40204)
Problem: possible integer overflow in spellfile tree bounds check
Solution: Rewrite the overflow check (Devon Krik)
The check 'startidx + len >= maxidx' uses signed int addition and can
overflow when startidx approaches INT_MAX. After overflow the wrapped
result bypasses the guard, allowing the subsequent loop to write
idxs[startidx + i] out of bounds on the heap.
Replace the addition with a safe subtractive check that maintains the
original >= semantics: len >= maxidx - startidx cannot overflow because
both operands are valid indices within [0, maxidx].
This fixes CWE-190 (Integer Overflow) leading to CWE-122 (Heap-based
Buffer Overflow).
closes: vim/vim#20483
https://github.com/vim/vim/commit/276920e138c276ffb1e6d5ec56879056a419453c
Co-authored-by: Devon Kirk <hyder365@users.noreply.github.com>
Diffstat (limited to 'test/functional/vimscript/executable_spec.lua')
0 files changed, 0 insertions, 0 deletions