diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-11-02 22:48:49 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-11-02 22:48:49 +0000 |
commit | 8a1962d1355096af55e84b1ea2f0baf5f1c5a5bc (patch) | |
tree | 3e1f03a08a267a3869d5d22c4e3f67f210930504 /src/register.c | |
parent | 69b3072d984480935ec412b32b97fea974d2b689 (diff) | |
download | vim-git-8a1962d1355096af55e84b1ea2f0baf5f1c5a5bc.tar.gz |
patch 8.2.3574: divide by zerov8.2.3574
Problem: Divide by zero.
Solution: Don't check for overflow if multiplicand is zero.
Diffstat (limited to 'src/register.c')
-rw-r--r-- | src/register.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/register.c b/src/register.c index 29ae26bd4..4160c0310 100644 --- a/src/register.c +++ b/src/register.c @@ -2014,8 +2014,9 @@ do_put( long multlen = count * yanklen; totlen = multlen; - if (totlen != multlen || totlen / count != yanklen - || totlen / yanklen != count) + if (count != 0 && yanklen != 0 + && (totlen != multlen || totlen / count != yanklen + || totlen / yanklen != count)) { emsg(_(e_resulting_text_too_long)); break; |