Apply upstream patch r1495 to our PCRE copy
It's actually a subset of the patch (tests, docs, other whitespace fixes were dropped). Fixes a stack overflow issue on pathological regexps reported upstream: http://bugs.exim.org/show_bug.cgi?id=1503 Change-Id: If080e4c1e7a86c86459bbbc631c8d8bb3cd7b99f Reviewed-by: Richard J. Moore <rich@kde.org>
This commit is contained in:
parent
88bd28f91e
commit
00ca499787
23
src/3rdparty/pcre/patches/pcre-r1495.patch
vendored
Normal file
23
src/3rdparty/pcre/patches/pcre-r1495.patch
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
Index: pcre_compile.c
|
||||||
|
===================================================================
|
||||||
|
--- pcre_compile.c (revision 1494)
|
||||||
|
+++ pcre_compile.c (revision 1495)
|
||||||
|
@@ -8267,12 +8267,16 @@
|
||||||
|
|
||||||
|
/* If it was a capturing subpattern, check to see if it contained any
|
||||||
|
recursive back references. If so, we must wrap it in atomic brackets.
|
||||||
|
- In any event, remove the block from the chain. */
|
||||||
|
+ Because we are moving code along, we must ensure that any pending recursive
|
||||||
|
+ references are updated. In any event, remove the block from the chain. */
|
||||||
|
|
||||||
|
if (capnumber > 0)
|
||||||
|
{
|
||||||
|
if (cd->open_caps->flag)
|
||||||
|
{
|
||||||
|
+ *code = OP_END;
|
||||||
|
+ adjust_recurse(start_bracket, 1 + LINK_SIZE,
|
||||||
|
+ (options & PCRE_UTF8) != 0, cd, cd->hwm);
|
||||||
|
memmove(start_bracket + 1 + LINK_SIZE, start_bracket,
|
||||||
|
IN_UCHARS(code - start_bracket));
|
||||||
|
*start_bracket = OP_ONCE;
|
||||||
|
|
6
src/3rdparty/pcre/pcre_compile.c
vendored
6
src/3rdparty/pcre/pcre_compile.c
vendored
@ -8193,12 +8193,16 @@ for (;;)
|
|||||||
|
|
||||||
/* If it was a capturing subpattern, check to see if it contained any
|
/* If it was a capturing subpattern, check to see if it contained any
|
||||||
recursive back references. If so, we must wrap it in atomic brackets.
|
recursive back references. If so, we must wrap it in atomic brackets.
|
||||||
In any event, remove the block from the chain. */
|
Because we are moving code along, we must ensure that any pending recursive
|
||||||
|
references are updated. In any event, remove the block from the chain. */
|
||||||
|
|
||||||
if (capnumber > 0)
|
if (capnumber > 0)
|
||||||
{
|
{
|
||||||
if (cd->open_caps->flag)
|
if (cd->open_caps->flag)
|
||||||
{
|
{
|
||||||
|
*code = OP_END;
|
||||||
|
adjust_recurse(start_bracket, 1 + LINK_SIZE,
|
||||||
|
(options & PCRE_UTF8) != 0, cd, cd->hwm);
|
||||||
memmove(start_bracket + 1 + LINK_SIZE, start_bracket,
|
memmove(start_bracket + 1 + LINK_SIZE, start_bracket,
|
||||||
IN_UCHARS(code - start_bracket));
|
IN_UCHARS(code - start_bracket));
|
||||||
*start_bracket = OP_ONCE;
|
*start_bracket = OP_ONCE;
|
||||||
|
Loading…
Reference in New Issue
Block a user