summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-11-02 22:48:49 +0000
committerBram Moolenaar <Bram@vim.org>2021-11-02 22:48:49 +0000
commit8a1962d1355096af55e84b1ea2f0baf5f1c5a5bc (patch)
tree3e1f03a08a267a3869d5d22c4e3f67f210930504
parent69b3072d984480935ec412b32b97fea974d2b689 (diff)
downloadvim-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.
-rw-r--r--src/register.c5
-rw-r--r--src/version.c2
2 files changed, 5 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;
diff --git a/src/version.c b/src/version.c
index f60263f02..98f666e6e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -758,6 +758,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3574,
+/**/
3573,
/**/
3572,