]> granicus.if.org Git - php/commitdiff
Fixed bug #31479 (Fixed crash in chunk_split(), when chunklen > strlen).
authorIlia Alshanetsky <iliaa@php.net>
Tue, 18 Jan 2005 15:47:57 +0000 (15:47 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 18 Jan 2005 15:47:57 +0000 (15:47 +0000)
ext/standard/string.c

index 1c9ee20d69ab24ca5730897410253603bc5c8d04..1b8916ec0b60b90144ee8af17ad1869357d5b204 100644 (file)
@@ -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();
        }