diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2014-08-08 23:36:45 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2014-08-10 14:18:26 +0200 |
commit | 00ca4997873354d6792eb9e5eee3d9a0e3c00c68 (patch) | |
tree | 0fc011802caa961a066f2f67eca439ad52fda087 /src/3rdparty/pcre/pcre_compile.c | |
parent | 88bd28f91ebc16093d886b5992eebe11c97cab2c (diff) |
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>
Diffstat (limited to 'src/3rdparty/pcre/pcre_compile.c')
-rw-r--r-- | src/3rdparty/pcre/pcre_compile.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/3rdparty/pcre/pcre_compile.c b/src/3rdparty/pcre/pcre_compile.c index 9708b93923..e3dd83b4cb 100644 --- a/src/3rdparty/pcre/pcre_compile.c +++ b/src/3rdparty/pcre/pcre_compile.c @@ -8193,12 +8193,16 @@ for (;;) /* 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; |