diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2005-01-18 15:47:57 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2005-01-18 15:47:57 +0000 |
commit | 1e6454a67b3a347a45d7a199173f2bb1dbf9c386 (patch) | |
tree | 646b61d0eae5f8f1f0448aae379ced8e37b034a8 | |
parent | 64e40c2271d142dd51f7e4ec329adf55ac44084c (diff) | |
download | php-git-1e6454a67b3a347a45d7a199173f2bb1dbf9c386.tar.gz |
Fixed bug #31479 (Fixed crash in chunk_split(), when chunklen > strlen).
-rw-r--r-- | ext/standard/string.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index 1c9ee20d69..1b8916ec0b 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1890,6 +1890,10 @@ PHP_FUNCTION(chunk_split) RETURN_FALSE; } + if (chunklen > Z_STRLEN_PP(p_str)) { + RETURN_STRINGL(Z_STRVAL_PP(p_str), Z_STRLEN_PP(p_str), 1); + } + if (!Z_STRLEN_PP(p_str)) { RETURN_EMPTY_STRING(); } |