Bug 669413
Summary: | pcre does not terminate on some unicode patterns | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Ondrej Moriš <omoris> |
Component: | pcre | Assignee: | Petr Pisar <ppisar> |
Status: | CLOSED ERRATA | QA Contact: | Jan Kepler <jkejda> |
Severity: | high | Docs Contact: | |
Priority: | urgent | ||
Version: | 5.6 | CC: | dkutalek, jkejda, ovasik, psplicha, tis, tsmetana |
Target Milestone: | rc | Keywords: | Patch, Regression, ZStream |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | pcre-6.6-7.el5 | Doc Type: | Bug Fix |
Doc Text: |
A previous update enabled Unicode properties to support \p{..}, \P{..}, and \X escape sequences. However, compiling certain regular expressions which contained extended classes under a non-UTF-8 PCRE mode failed due to the compilation entering an infinite loop. This has been fixed in this update so that compiling such regular expressions completes as expected.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2013-09-30 21:58:23 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: | 680962 | ||
Attachments: |
Created attachment 473363 [details]
Fix for looping on pattern compilation in non-UTF-8
I believe I found fix for the loop problem. This attachment should fix it.
Created attachment 473365 [details]
Test case for the loop problem
This C program tests the loop problem. If the problem is fixed, the program
returns with success code in finite time. Otherwise it times out after 5 seconds and returns failure code.
Created attachment 473502 [details]
Complete backport of infinite loop bugfix
Your backport seem to be incomplete. I attached more complete backport. Test case which shows the difference is to change this pattern to test program: const char pattern[] = "/ ([\\p{Nd}]) (abc) (?2) /"; Created attachment 473857 [details]
Fix for looping on pattern compilation in non-UTF-8
Annotated patch fixing both recursion and both bracket search.
Created attachment 473858 [details]
Test case for the loop problem
Test case with both mentioned patterns.
(In reply to comment #7) > Your backport seem to be incomplete. > Thank you very much. I would welcome a pointer to relevant discussion or VCS repository as upstream moved to new VCS and mailing list at the begin of year 2007 throwing previous development history away. I checked whole pcre_compile.c for OP_XCLASS against pcre-6.7. I hope that's everything. No idea about VCS link or anything. Second test pattern was invented by Kim Heino when he looked at your backport and why our backport was different than your original one. 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-2013-1298.html |
Created attachment 473362 [details] Fix for looping on pattern compilation in non-UTF-8 I believe I found fix for the loop problem. This attachment should fix it.