]> granicus.if.org Git - php/commitdiff
Fix for a regex bug that leads into an infinite loop due to optimization
authorMoriyoshi Koizumi <moriyoshi@php.net>
Thu, 2 Oct 2003 08:01:14 +0000 (08:01 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Thu, 2 Oct 2003 08:01:14 +0000 (08:01 +0000)
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.

ext/mbstring/mbregex.c

index 1e6c6effc1608f029493cbbdd1861abaf528c91c..cfda5b4404114ec5b8b4153c4efcf75f3e37b696 100644 (file)
@@ -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;