develooper Front page | perl.perl5.changes | Postings from October 2020

[Perl/perl5] bb5864: Fix GH #17278

From:
Karl Williamson via perl5-changes
Date:
October 23, 2020 14:07
Subject:
[Perl/perl5] bb5864: Fix GH #17278
Message ID:
Perl/perl5/push/refs/heads/blead/28df11-bb5864@github.com
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: bb58640a409949759318542317e353e2241cc408
      https://github.com/Perl/perl5/commit/bb58640a409949759318542317e353e2241cc408
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-10-23 (Fri, 23 Oct 2020)

  Changed paths:
    M regcomp.c
    M t/re/pat_advanced.t

  Log Message:
  -----------
  Fix GH #17278

This was an assertion failure in regexec.c under rare circumstances.  A
reduction of the fuzzed test case is now in pat_advanced.t

The root cause of this was that the pattern being compiled was encoded in
UTF-8 and 'use locale' was in effect, equivalent to the /l charset, and
then the charset was reset inside the pattern, to /d.  But /d in a UTF-8
patterns is illegal, hence the later assertion failure.

The solution is to reset instead to /u when the pattern is UTF-8.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About