This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug regex/558] New: regcomp and regexec bug


Some regular expressions make regcomp to eat CPU and memory.
Try run date |egrep '.{1,2048}' and enjoy the result if you're patient enough.

Test case:
#include <stdio.h>
#include <regex.h>

int main(void) {
    char s[] = "/.{1,2048}.{1,2048}.{1,2048}.{1,2048}.{1,2048}/";
    regex_t reg;                      
    int res;    
    fprintf(stderr, "starting\n");
    res = regcomp(&reg, s, REG_EXTENDED);
    fprintf(stderr, "regcomp(&reg, '%s', REG_EXTENDED) = %d\n", s, res);
}

This bug appeared in between 2.2.5 and 2.3:

> date: 2002/02/27 19:00:56;  author: drepper;  state: Exp;  lines: +7 -8399
> Check in complete rewrite.

-- 
           Summary: regcomp and regexec bug
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: regex
        AssignedTo: gotom at debian dot or dot jp
        ReportedBy: vprodan dot hosting at artstyle dot ru
                CC: glibc-bugs-regex at sources dot redhat dot com,glibc-
                    bugs at sources dot redhat dot com,vprodan dot hosting
                    at artstyle dot ru
 GCC build triplet: i686-pc-linux-gnu


http://sources.redhat.com/bugzilla/show_bug.cgi?id=558

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]