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:
@@ -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;
|
||||
|
@@ -757,6 +757,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
3574,
|
||||
/**/
|
||||
3573,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user