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

diff --git a/NEWS b/NEWS
index f442ecc92bf3e5104c0fd9be160748465f8ed082..6d6a1be0a4938c2b19bf7f2d1425bcfd8b294309 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ PHP 4                                                                      NEWS
 - Fixed MacOSX shared extensions crashing on Apache startup. (Rasmus)
 - Added Oracle Instant Client support. (cjbj at hotmail dot com, Tony)
 - Fixed bug #31580 (fgetcsv() problematic with "" escape sequences). (Ilia)
+- Fixed bug #31479 (Fixed crash in chunk_split(), when chunklen > strlen). (Ilia)
 - Fixed bug #31454 (session_set_save_handler crashes PHP when supplied
   non-existent object ref). (Tony)
 - Fixed bug #31444 (Memory leak in zend_language_scanner.c).
index 556da7ba513ca07d50cd8e3560df16931956b301..9ee87aa874e08cd42d2e931cb5d3e4ee8c72db6f 100644 (file)
@@ -1575,6 +1575,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();
        }