|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2014-02-26 08:17 UTC] krakjoe@php.net
-Assigned To:
+Assigned To: derick
[2017-10-24 08:08 UTC] kalle@php.net
-Status: Assigned
+Status: Open
-Assigned To: derick
+Assigned To:
[2020-12-18 12:24 UTC] cmb@php.net
-Status: Open
+Status: Verified
-Type: Bug
+Type: Documentation Problem
-Assigned To:
+Assigned To: cmb
[2020-12-18 12:24 UTC] cmb@php.net
[2020-12-18 12:37 UTC] cmb@php.net
[2020-12-18 12:38 UTC] phpdocbot@php.net
[2020-12-18 12:38 UTC] phpdocbot@php.net
-Status: Verified
+Status: Closed
[2020-12-18 23:54 UTC] mumumu@php.net
[2020-12-18 23:55 UTC] phpdocbot@php.net
[2020-12-30 11:58 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 06:00:01 2025 UTC |
Description: ------------ strftime returns empty string when input fmt string exceeds 1024 due to the undocumented code logic in 'ext/date/php_date.c' php_strftime ... int max_reallocs = 5; size_t buf_len = 256, real_len; ... buf = (char *) emalloc(buf_len); while ((real_len=strftime(buf, buf_len, format, &ta))==buf_len || real_len==0) { buf_len *= 2; buf = (char *) erealloc(buf, buf_len); if (!--max_reallocs) { break; } } ... the logic to abort reallocation after 5 times is undocumented. thus we can have at most 256 * 5 = 1024 size string. Test script: --------------- echo strftime(str_repeat('x', 1024)); Expected result: ---------------- should output 1024 occurrences of 'x' Actual result: -------------- empty string