This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
APItest/t/utf8_warn_base.pl: Add a test
authorKarl Williamson <khw@cpan.org>
Tue, 4 Jul 2017 18:57:40 +0000 (12:57 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 13 Jul 2017 03:14:26 +0000 (21:14 -0600)
This verifies that we don't mistake an overlong for overflow

ext/XS-APItest/t/utf8_warn_base.pl

index 189813d..8d8fb5d 100644 (file)
@@ -412,6 +412,10 @@ my @tests;
     if (! $::is64bit) {
         if (isASCII) {
             push @tests,
+                [ "overlong malformation, but naively looks like overflow",
+                    "\xff\x80\x80\x80\x80\x80\x80\x83\xbf\xbf\xbf\xbf\xbf",
+                    0xFFFFFFFF,
+                ],
                 [ "overflow that old algorithm failed to detect",
                     "\xfe\x86\x80\x80\x80\x80\x80",
                     -1,