This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Return REPLACEMENT for UTF-8 empty malformation
authorKarl Williamson <khw@cpan.org>
Wed, 14 Dec 2016 18:38:42 +0000 (11:38 -0700)
committerKarl Williamson <khw@cpan.org>
Fri, 23 Dec 2016 23:48:35 +0000 (16:48 -0700)
commit5a48568dae7e81342fc2f8d0845423834f5c818f
tree255923c76214f0142ba304aa6fe7295e118b7103
parentd1f8d421df731c77beff3db92d27dc6ec28589f2
Return REPLACEMENT for UTF-8 empty malformation

The previous commit no longer allows this so-called malformation under
DEBUGGING builds, except if code explicitly changes to request it (or
already explicitly does, but there are no instances of this in CPAN).

If it is explicitly allowed, prior to this commit it returned NUL.  If
it wasn't allowed, it returned 0.  Most code won't treat these as
different.  When returning NUL, it basically is making nothing into
something, which might be exploitable some way by an attacker.  The
Unicode accepted way of dealing with malformations is to replace them
with the REPLACEMENT CHARACTER, and so this commit changes things to
conform to this.
ext/XS-APItest/t/utf8.t
pod/perldelta.pod
utf8.c