]> granicus.if.org Git - php/commitdiff
Bug #67238 Ungreedy and min/max quantifier bug in PCRE 8.34 upstream
authorAnatol Belski <ab@php.net>
Fri, 9 May 2014 20:15:54 +0000 (22:15 +0200)
committerAnatol Belski <ab@php.net>
Fri, 9 May 2014 20:15:54 +0000 (22:15 +0200)
upstream patch applied

NEWS
ext/pcre/pcrelib/pcre_compile.c
ext/pcre/tests/bug67238.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 457b1e8c1b30c2c7f242ed3f8d546ce53165327c..e2803d6dfc58ff88bf22e1a736ac168b34010b70 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,10 @@ PHP                                                                        NEWS
   . Fixed bug #66908 (php-fpm reload leaks epoll_create() file descriptor).
     (Julio Pintos)
 
+- PCRE:
+  . Fixed bug #67238 (Ungreedy and min/max quantifier bug, applied patch
+    from the upstream). (Anatol)
+
 - Phar:
   . Fix bug #64498 ($phar->buildFromDirectory can't compress file with an accent
     in its name). (PR #588)
index c170c47a004220d9fbae5c05189d8fb7e6245c22..853fb2479350b72f788363f64b4a85a765a4586e 100644 (file)
@@ -3623,7 +3623,7 @@ for (;;)
         break;
 
         case OP_MINUPTO:
-        *code += OP_MINUPTO - OP_UPTO;
+        *code += OP_POSUPTO - OP_MINUPTO;
         break;
         }
       }
diff --git a/ext/pcre/tests/bug67238.phpt b/ext/pcre/tests/bug67238.phpt
new file mode 100644 (file)
index 0000000..117662a
--- /dev/null
@@ -0,0 +1,10 @@
+--TEST--
+Bug #67238 Ungreedy and min/max quantifier bug in PCRE 8.34 upstream
+--FILE--
+<?php
+
+echo preg_match('/a{1,3}b/U', 'ab');
+
+?>
+--EXPECTF--
+1