diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2010-03-08 08:57:04 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2010-03-08 08:57:04 +0000 |
commit | 5783ade86fa125a2c886ad890c49d601797c90b6 (patch) | |
tree | 2e0e58d320a0c3b5ed037ccbcd23b91fc00585b4 /pcre_compile.c | |
parent | 49c56a265833ec84377194fb95cf09b6592edf18 (diff) | |
download | pcre-5783ade86fa125a2c886ad890c49d601797c90b6.tar.gz |
Previous patch for fixing problem with recursion loop checking was incorrect.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@504 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcre_compile.c')
-rw-r--r-- | pcre_compile.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pcre_compile.c b/pcre_compile.c index 77b7c09..1a62ccb 100644 --- a/pcre_compile.c +++ b/pcre_compile.c @@ -1828,14 +1828,20 @@ for (code = first_significant_code(code + _pcre_OP_lengths[*code], NULL, 0, TRUE if (c == OP_RECURSE) { + BOOL empty_branch = FALSE; const uschar *scode = cd->start_code + GET(code, 1); if (GET(scode, 1) == 0) return TRUE; /* Unclosed */ do { - if (!could_be_empty_branch(scode, endcode, utf8, cd)) return FALSE; + if (could_be_empty_branch(scode, endcode, utf8, cd)) + { + empty_branch = TRUE; + break; + } scode += GET(scode, 1); } while (*scode == OP_ALT); + if (!empty_branch) return FALSE; /* All branches are non-empty */ continue; } |