From 47b41a5d6c1d78949680e2bbdcd8ad5769f010ba Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Thu, 22 Jun 2006 18:44:31 +0000 Subject: [PATCH] MFH: don't try to parse empty string, return false immediately (fixes off-by-one) --- ext/date/php_date.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) { -- 2.40.0