This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PATCH: [perl #128628] divide by 0 in locale.c
authorKarl Williamson <khw@cpan.org>
Thu, 14 Jul 2016 04:06:30 +0000 (22:06 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 14 Jul 2016 22:10:10 +0000 (16:10 -0600)
commite1c30f0c87de26774c1fbe11ab7536e439285070
tree48f6d84c6cb60393306324db4398f98bc2be8e88
parent7a0be72ee91841d7e4109296e11dc081097afbfe
PATCH: [perl #128628] divide by 0 in locale.c

It turned out to be possible to divide by 0 in Win32 when trying to find
the strxfrm() of an empty string.  On other platforms, the result of
this is consistent with other strings, but on Windows, it is longer than
expected, and the code was trying to adapt to this, dividing by the
input length without checking its validity.  This commit just skips the
adapting on a 0-length input.
lib/locale.t
locale.c