This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.c: Fix bugs with overlongs combined with other malformations.
authorKarl Williamson <khw@cpan.org>
Mon, 19 Jun 2017 18:58:19 +0000 (12:58 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 13 Jul 2017 03:14:25 +0000 (21:14 -0600)
commit6c64cd9dad2f8d5da8eb9122ab251b85430718e2
tree8ec95048c9f53f55c4f179c5fb9d203b62cf3950
parent717dd9f90cd9f85157fcc3cb27284614dc319825
utf8.c: Fix bugs with overlongs combined with other malformations.

The code handling the UTF-8 overlong malformation must come after
handling all the other malformations.  This is because it may change the
code point represented to the REPLACEMENT CHARACTER.  The other
malformation code is expecting the code point to be the original one.
This may cause failure to catch and report other malformations, or
report the wrong value of the erroneous code point.

What was needed was simply to move the 'if else' branch for overlongs to
after the branches for the other formations.
ext/XS-APItest/t/utf8_warn_base.pl
utf8.c