# HG changeset patch # User Bram Moolenaar # Date 1635894005 -3600 # Node ID 6b6163d42b228680c1bfdb02e6493a6e930e1f33 # Parent e335df170d4d14b7d8ede7611c11bafa58fedc18 patch 8.2.3574: divide by zero Commit: https://github.com/vim/vim/commit/8a1962d1355096af55e84b1ea2f0baf5f1c5a5bc Author: Bram Moolenaar Date: Tue Nov 2 22:48:49 2021 +0000 patch 8.2.3574: divide by zero Problem: Divide by zero. Solution: Don't check for overflow if multiplicand is zero. diff --git a/src/register.c b/src/register.c --- 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 --- 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,