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 | Thread Next
From:
Clarke, Dave S via RT
Date:
September 16, 2008 04:10
Subject:
RE: [rt.cpan.org #39233] Suspected buffer overflow while running executable made by Par::Packer
Message ID:
rt-3.6.HEAD-11521-1221498226-1856.39233-15-0@rt.cpan.org
Mon Sep 15 13:03:46 2008: Request 39233 was acted upon.
Transaction: Correspondence added by dave_clarke@merck.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 Steffen,

Thanks for your quick response to this.  This was work related, so I put
it aside over the weekend.

I did take a second look at the regexp.  If you knew what I was trying
to parse, you may not think it was quite so diabolocal.  I was parsing
some text, that included some strings in double quotes.  The odd part is
that, instead of escaping an embedded double quote with a back slash,
they escape it with a second double quote.  Therefore, I am dealing with
a string like the following example.

TEXT="this is a string with an ""embedded quotation"" in it".

I decided it was much easier to parse, if I replaced the consecutive
double qutoes with a control character, match a much simpler quoted
string, then restore the embedded double quote.

The example you sent looked like it was using an experimental feature
[?>] -- or maybe I'm looking at old documentation.

Anyways, I have a good solution to the problem for now.  However, there
was a difference between the way the interpreted perl code ran, and the
.exe created by Par::Packer.  If I can create a simple script, and .exe
that I can forward to you, I will.  

Again, thanks for your help.


-----Original Message-----
From: Steffen Mueller via RT [mailto:bug-PAR@rt.cpan.org]
Sent: Saturday, September 13, 2008 9:39 AM
To: Clarke, Dave S
Subject: Re: [rt.cpan.org #39233] Suspected buffer overflow while
running executable made by Par::Packer

<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



Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or
MSD and in Japan, as Banyu - direct contact information for affiliates is
available at http://www.merck.com/contact/contacts.html) that may be
confidential, proprietary copyrighted and/or legally privileged. It is
intended solely for the use of the individual or entity named on this
message. If you are not the intended recipient, and have received this
message in error, please notify us immediately by reply e-mail and
then delete it from your system.


Thread Previous | Thread Next


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