[Bug regex/25322] New: regex mishandles back-references inside interval expressions

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Bug regex/25322] New: regex mishandles back-references inside interval expressions

glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=25322

            Bug ID: 25322
           Summary: regex mishandles back-references inside interval
                    expressions
           Product: glibc
           Version: 2.30
            Status: NEW
          Severity: normal
          Priority: P2
         Component: regex
          Assignee: unassigned at sourceware dot org
          Reporter: eggert at cs dot ucla.edu
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Created attachment 12153
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12153&action=edit
C program illustrating bug with back-references inside intervals

The glibc regular expression code mishandles regular expressions such as:

   .*((.)\2){2}$

as it does not backtrack enough to find a match that satisfies the
back-references when they are used twice.

To reproduce the problem, compile and run the attached file backrefbug.c. It
will exit with status 2, whereas the correct exit status is 0.

This bug was originally reported against GNU 'grep' here:

https://bugs.gnu.org/26864

and you can find more test cases by reading that bug report.

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