From: David Croft Date: Wed, 10 Jan 2001 04:01:02 +0000 (+0000) Subject: Allocate buffer in date() for the actual length of the timezone (bug#8292) X-Git-Tag: php-4.0.5RC1~634 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0afe88cbc6818f9d00e96294149270d0c55547a0;p=php Allocate buffer in date() for the actual length of the timezone (bug#8292) --- diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index 15c417ee24..159804d034 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -255,9 +255,15 @@ php_date(INTERNAL_FUNCTION_PARAMETERS, int gm) break; case 'F': /* month, textual, full */ case 'l': /* day (of the week), textual */ - case 'T': /* timezone name */ size += 28; break; + case 'T': /* timezone name */ +#if HAVE_TM_ZONE + size += strlen(ta->tm_zone); +#else + size += strlen(tzname[0]); +#endif + break; case 'Z': /* timezone offset in seconds */ size += 6; break;