Bug#527039: perl: Regex fails when string is too long

Marcel Meckel debian at thermoman.de
Tue May 5 08:10:24 UTC 2009


Package: perl
Version: 5.10.0-19
Severity: important


In 5.10 and newer a regex begins to fail if a matching string
is longer than 32767 chars.

Upstream bug: http://rt.perl.org/rt3/Public/Bug/Display.html?id=65372

Script to reproduce:

---------------
use strict;
use warnings;

parse("x" x 32767);
parse("x" x 32768);

sub parse {
my $xml = shift;

$xml = "<html>${xml}</html>";

my $tag = "html";

if ( $xml =~ m{<$tag>(.|\n)*?</$tag>}i ) {
print "matched\n";
}
else {
print "didn't match\n";
}
}
---------------



-- System Information:
Debian Release: 5.0.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686-bigmem (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages perl depends on:
ii  libc6                         2.7-18     GNU C Library: Shared libraries
ii  libdb4.6                      4.6.21-11  Berkeley v4.6 Database Libraries [
ii  libgdbm3                      1.8.3-3    GNU dbm database routines (runtime
ii  perl-base                     5.10.0-19  minimal Perl system
ii  perl-modules                  5.10.0-19  Core Perl modules

Versions of packages perl recommends:
ii  netbase                       4.34       Basic TCP/IP networking system

Versions of packages perl suggests:
pn  libterm-readline-gnu-perl | l <none>     (no description available)
pn  perl-doc                      <none>     (no description available)

-- no debconf information






More information about the Perl-maintainers mailing list