[pcre-dev] [Bug 2126] New: Segfault due to stack overflow fo…

Page principale
Supprimer ce message
Auteur: admin
Date:  
À: pcre-dev
Nouveaux-sujets: [pcre-dev] [Bug 2126] Segfault due to stack overflow for long strings matching a recursive regex, [pcre-dev] [Bug 2126] Segfault due to stack overflow for long strings matching a recursive regex
Sujet: [pcre-dev] [Bug 2126] New: Segfault due to stack overflow for long strings matching a recursive regex
https://bugs.exim.org/show_bug.cgi?id=2126

            Bug ID: 2126
           Summary: Segfault due to stack overflow for long strings
                    matching a recursive regex
           Product: PCRE
           Version: 7.8
          Hardware: x86
                OS: Linux
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
          Assignee: ph10@???
          Reporter: camille.brugel@???
                CC: pcre-dev@???


Hello,

prcegrep version 7.8 is segfaulting, (probably) due to a stack overflow for
long strings matching a recursive regex.

Ex:

test=$(echo -n "{"; for i in $(seq 15);do; echo -n "a"; done; echo -n "}");echo
$test | perl -ne "print if m/{([^{}]|(?R))*}/g"
<WORKS FINE...>
test=$(echo -n "{"; for i in $(seq 15000);do; echo -n "a"; done; echo -n
"}");echo $test | perl -ne "print if m/{([^{}]|(?R))*}/g"
<SEGFAULT>

Loading the core I get the same address thousands times, so it looks very much
like a stack overflow. It will probably mean rewriting the recursive regexp
behavior quite heavily (probably not a small fix) not using recursion for
(well...) recursive regex.

Cheers,

Camille

--
You are receiving this mail because:
You are on the CC list for the bug.