This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix leak in Perl__force_out_malformed_utf8_message()
authorDavid Mitchell <davem@iabyn.com>
Tue, 26 Mar 2019 14:58:04 +0000 (14:58 +0000)
committerDavid Mitchell <davem@iabyn.com>
Fri, 29 Mar 2019 15:10:20 +0000 (15:10 +0000)
commitdd0510590a1124f91ef2c615a64cd9bfbb245dd6
tree5bf49d03f7e715ada667f534b954a16fcb48b9f0
parentb7502288af31c8825a7da7573538e6ce58a641c3
fix leak in Perl__force_out_malformed_utf8_message()

This function temporarily sets PL_curcop->cop_warnings to pWARN_ALL in
order to enforce mandatory warnings about malformed utf8, but it
didn't restore cop_warnings, so the old value leaked.

Can be reproduced with, e.g.

    no warnings 'utf8';
    CORE::evalbytes qq{ use utf8; "\\N{abc\x{c0}}"};

which is already exercised in t/uni/parser.t.
utf8.c