From 3650bab76f08ee9cb5dfa21861bbc9de2cd666d8 Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Sun, 14 Jul 2002 22:36:47 +0000 Subject: [PATCH] Fix Bug #18341. @- Fixed cases where preg_split() incorrectly terminated final element if @ it contained null byte. (Andrei) --- ext/pcre/php_pcre.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 9045d43bcd..0884e6b929 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1245,8 +1245,9 @@ PHP_FUNCTION(preg_split) add_offset_pair(return_value, &Z_STRVAL_PP(subject)[start_offset], Z_STRLEN_PP(subject) - start_offset, start_offset); } else { /* Add the last piece to the return value */ - add_next_index_string(return_value, - &Z_STRVAL_PP(subject)[start_offset], 1); + add_next_index_stringl(return_value, + &Z_STRVAL_PP(subject)[start_offset], + Z_STRLEN_PP(subject) - start_offset, 1); } } -- 2.40.0