develooper Front page | perl.par | Postings from September 2008

Re: [rt.cpan.org #39233] Suspected buffer overflow while running executable made by Par::Packer

Thread Previous
From:
Steffen Mueller via RT
Date:
September 13, 2008 22:16
Subject:
Re: [rt.cpan.org #39233] Suspected buffer overflow while running executable made by Par::Packer
Message ID:
rt-3.6.HEAD-24620-1221313129-417.39233-15-0@rt.cpan.org
Sat Sep 13 09:38:49 2008: Request 39233 was acted upon.
Transaction: Correspondence added by wyp3rlx02@sneakemail.com
       Queue: PAR
     Subject: Re: [rt.cpan.org #39233] Suspected buffer overflow while running executable made by Par::Packer
   Broken in: (no value)
    Severity: (no value)
       Owner: Nobody
  Requestors: dave_clarke@merck.com
      Status: open
 Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=39233 >


Hi again,

Clarke, Dave S via RT wrote:
> Fri Sep 12 16:31:35 2008: Request 39233 was acted upon.
> Transaction: Ticket created by dave_clarke@merck.com
>        Queue: PAR
>      Subject: Suspected buffer overflow while running executable made by Par::Packer
[...]

> 		$_ =
> q[TEXT="some_very_large_text_to_be_extracted_between_double_quotes"];
> 		my $rQStr = qr/"((?:""|[^"])*)"/;
> # String between double quotes (")
> 		my $key = 'TEXT';
> 		if (m/${key}=${rQStr}/) {
> 			$_ = $1;

It's likely that this isn't a PAR::Packer issue after all. That regex
was triggering some alarms when I first saw it, but I wasn't entirely
sure at the time. Since then, I talked to somebody who knows Perl
regexes inside out and he simply called it a "diabolical pattern". It'll
use one stack frame per input character. The details aren't clear to me,
but it's pretty obvious that by replacing the regex with a less evil
one, you'll fix the code.

The quick suggestion was:
my $rQStr = qr/"((?>(""|[^"]+)*))"/;

He wasn't entirely sure it'd be right because it was way past end of
work time for both of us.

Best regards,
Steffen


Thread Previous


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