1
0
forked from aniani/vim

patch 8.2.3574: divide by zero

Problem:    Divide by zero.
Solution:   Don't check for overflow if multiplicand is zero.
This commit is contained in:
Bram Moolenaar
2021-11-02 22:48:49 +00:00
parent 69b3072d98
commit 8a1962d135
2 changed files with 5 additions and 2 deletions

View File

@@ -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;

View File

@@ -757,6 +757,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3574,
/**/
3573,
/**/