From: Andrei Zmievski Date: Sun, 14 Jul 2002 22:36:47 +0000 (+0000) Subject: Fix Bug #18341. X-Git-Tag: dev~297 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3650bab76f08ee9cb5dfa21861bbc9de2cd666d8;p=php Fix Bug #18341. @- Fixed cases where preg_split() incorrectly terminated final element if @ it contained null byte. (Andrei) --- 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); } }