mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:9.0.1847: [security] potential oob write in do_addsub()
Problem: potential oob write in do_addsub()
Solution: don't overflow buf2, check size in for loop()
889f6af371
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
b55010a539
commit
15298e7926
@ -4770,7 +4770,7 @@ int do_addsub(int op_type, pos_T *pos, int length, linenr_T Prenum1)
|
||||
}
|
||||
}
|
||||
|
||||
while (bits > 0) {
|
||||
while (bits > 0 && i < NUMBUFLEN - 1) {
|
||||
buf2[i++] = ((n >> --bits) & 0x1) ? '1' : '0';
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user