From: Antony Dovgal Date: Thu, 22 Jun 2006 18:44:31 +0000 (+0000) Subject: MFH: X-Git-Tag: php-5.2.0RC1~262 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47b41a5d6c1d78949680e2bbdcd8ad5769f010ba;p=php MFH: don't try to parse empty string, return false immediately (fixes off-by-one) --- diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 18c0f32b57..c9c5d26da8 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1063,6 +1063,10 @@ PHP_FUNCTION(strtotime) RETURN_FALSE; } + if (!time_len) { + RETURN_FALSE; + } + t = timelib_strtotime(times, time_len, &error, DATE_TIMEZONEDB); error1 = error->error_count; timelib_error_container_dtor(error); @@ -1078,7 +1082,7 @@ PHP_FUNCTION(strtotime) timelib_tzinfo_dtor(t->tz_info); } - timelib_time_dtor(now); + timelib_time_dtor(now); timelib_time_dtor(t); if (error1 || error2) {