diff options
author | Andrei Zmievski <andrei@php.net> | 2002-07-14 22:36:47 +0000 |
---|---|---|
committer | Andrei Zmievski <andrei@php.net> | 2002-07-14 22:36:47 +0000 |
commit | 3650bab76f08ee9cb5dfa21861bbc9de2cd666d8 (patch) | |
tree | 688e30533cfe9403c96beda3cb239befc0190558 /ext/pcre/php_pcre.c | |
parent | da1a01ee934162065f8f61f6a4b10522e5304af1 (diff) | |
download | php-git-3650bab76f08ee9cb5dfa21861bbc9de2cd666d8.tar.gz |
Fix Bug #18341.
@- Fixed cases where preg_split() incorrectly terminated final element if
@ it contained null byte. (Andrei)
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r-- | ext/pcre/php_pcre.c | 5 |
1 files 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); } } |