From 56cdaecb284b2b292ce1ecb076c1f8b041e47a02 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 28 Jul 2016 13:56:40 +0200 Subject: Fix #72693: mb_ereg_search increments search position when a match zero-width That's caused by an off-by-one error, which we fix. --- ext/mbstring/php_mbregex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/mbstring/php_mbregex.c') diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 3509165ca9..a295f54e4e 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -1261,7 +1261,7 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode) break; } end = MBREX(search_regs)->end[0]; - if (pos < end) { + if (pos <= end) { MBREX(search_pos) = end; } else { MBREX(search_pos) = pos + 1; -- cgit v1.2.1