summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_mbregex.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmb@php.net>2016-07-28 13:56:40 +0200
committerChristoph M. Becker <cmb@php.net>2016-07-28 13:57:38 +0200
commit56cdaecb284b2b292ce1ecb076c1f8b041e47a02 (patch)
tree9a4c71eb5d6dbad16e4de8125409a5a965119162 /ext/mbstring/php_mbregex.c
parentd276e6a8386a68d57d5dd07c3d7e15de4b03c6b3 (diff)
downloadphp-git-56cdaecb284b2b292ce1ecb076c1f8b041e47a02.tar.gz
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.
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r--ext/mbstring/php_mbregex.c2
1 files changed, 1 insertions, 1 deletions
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;