Bug 756105

Summary: Forward reference doesn't work when repeated twice or more
Product: Red Hat Enterprise Linux 6 Reporter: Petr Pisar <ppisar>
Component: pcreAssignee: Petr Pisar <ppisar>
Status: CLOSED ERRATA QA Contact: Lukáš Zachar <lzachar>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2Keywords: Patch
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: http://lists.pcre.org/lurker/message/20111121.203922.3cfd476e.en.html
Whiteboard:
Fixed In Version: pcre-7.8-6.el6 Doc Type: Bug Fix
Doc Text:
Cause: Matching pattern with repeated forward reference (e.g. /(a)(?2){2}(.)/). Consequence: The pattern will not match erroneously if first character does not repeated at the start of matching text. Fix: Matching algorithm has been changed not to expect the leading character again. Result: Pattern with repeated forward references matches correctly (e.g. `abcd') now.
Story Points: ---
Clone Of: 755969 Environment:
Last Closed: 2012-09-07 10:48:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 836160    
Attachments:
Description Flags
Fix ported from upstream development tree none

Description Petr Pisar 2011-11-22 17:17:45 UTC
+++ This bug was initially created as a clone of Bug #755969 +++

Fetch following input to pcretest:

/(a)(?2){2}(.)/
abcd

It should match as well as /(a)(..)(.)/, but it doesn't with pcre-8.12-4.fc16.x86_64.

This is fixed in SVN commit r762.

--- Additional comment from ppisar on 2011-11-22 15:01:42 GMT ---

(In reply to comment #0)
> It should match as well as /(a)(..)(.)/, but it doesn't
Actually as /(a)(?:..)(.)/ because subroutine is not capturing.
-----

RHEL-6 (pcre-7.8-3.1.el6.x86_64) affected.

Comment 2 Petr Pisar 2011-11-22 17:35:22 UTC
Created attachment 535133 [details]
Fix ported from upstream development tree

Comment 3 Petr Pisar 2011-11-22 17:39:09 UTC
When testing, make sure non-repeated references (e.g. /(a)(?2)(.)/  on "abc") still work.

Comment 5 Suzanne Logcher 2012-02-14 23:20:56 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 14 errata-xmlrpc 2012-09-07 10:48:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-1240.html