mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.4065: computation overflow with large cound for :yank
Problem: Computation overflow with large cound for :yank. Solution: Avoid an overflow.
This commit is contained in:
@@ -2374,7 +2374,10 @@ do_one_cmd(
|
||||
else
|
||||
{
|
||||
ea.line1 = ea.line2;
|
||||
ea.line2 += n - 1;
|
||||
if (ea.line2 >= LONG_MAX - (n - 1))
|
||||
ea.line2 = LONG_MAX; // avoid overflow
|
||||
else
|
||||
ea.line2 += n - 1;
|
||||
++ea.addr_count;
|
||||
/*
|
||||
* Be vi compatible: no error message for out of range.
|
||||
|
Reference in New Issue
Block a user