changeset 26081:6b6163d42b22 v8.2.3574

patch 8.2.3574: divide by zero Commit: https://github.com/vim/vim/commit/8a1962d1355096af55e84b1ea2f0baf5f1c5a5bc Author: Bram Moolenaar <Bram@vim.org> 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.
author Bram Moolenaar <Bram@vim.org>
date Wed, 03 Nov 2021 00:00:05 +0100
parents e335df170d4d
children b09f70b14a30
files src/register.c src/version.c
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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,