This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
product() with zero IV crash/hang
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 29 Feb 2016 13:39:02 +0000 (08:39 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 1 Mar 2016 01:44:20 +0000 (20:44 -0500)
commitd962874bb2fb8159ec2e9f58745d6d02b56e84c7
tree749b6d80a29c4364e699c6e22d8787a24c2de913
parent98e2bb74e9450c612d85b3f54540f899f9e3a7ea
product() with zero IV crash/hang

CID 104785: Division or modulo by zero (DIVIDE_BY_ZERO)
238. divide_by_zero: In expression 9223372036854775807L / retiv, division by expression retiv which may be zero has undefined behavior.
215                if(!SvNOK(sv) && SvIOK(sv) && (SvIV(sv) < IV_MAX / retiv)) {

Cherry-pick of the changes in
https://rt.cpan.org/Public/Bug/Display.html?id=105415
cpan/Scalar-List-Utils/ListUtil.xs
cpan/Scalar-List-Utils/t/product.t