From: Moriyoshi Koizumi Date: Thu, 2 Oct 2003 08:01:14 +0000 (+0000) Subject: Fix for a regex bug that leads into an infinite loop due to optimization X-Git-Tag: php-4.3.4RC2~78 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6e6732ae6a62869d9f56a5bcf18ac721865ef059;p=php Fix for a regex bug that leads into an infinite loop due to optimization failure when the pattern is ".*" and both MULTILINE and SINGLELINE options are specified. # This bug was already squashed in HEAD, as it adopts an alternative # implementation. --- diff --git a/ext/mbstring/mbregex.c b/ext/mbstring/mbregex.c index 1e6c6effc1..cfda5b4404 100644 --- a/ext/mbstring/mbregex.c +++ b/ext/mbstring/mbregex.c @@ -3326,7 +3326,7 @@ re_search(bufp, string, size, startpos, range, regs) } } if (bufp->options & MBRE_OPTIMIZE_ANCHOR) { - if (bufp->options&MBRE_OPTION_SINGLELINE) { + if (bufp->options&MBRE_OPTION_MULTILINE & range > 0) { goto begbuf_match; } anchor = 1;