diff options
author | Markus Fischer <mfischer@php.net> | 2002-01-20 20:16:54 +0000 |
---|---|---|
committer | Markus Fischer <mfischer@php.net> | 2002-01-20 20:16:54 +0000 |
commit | fe6e7058eedfc30ef766185aebc95e1e41437c45 (patch) | |
tree | a23909d85dc1308af84dcfa36b4abf42a54ad243 | |
parent | cb0a09808ffe3bfbf9384dde33e633aa245ebc62 (diff) | |
download | php-git-fe6e7058eedfc30ef766185aebc95e1e41437c45.tar.gz |
- Fix crash with invalid localtime on Win32 systems.
-rw-r--r-- | ext/standard/datetime.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index fe9b01d283..63d3bafe2d 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -586,7 +586,11 @@ PHP_FUNCTION(localtime) assoc_array = Z_LVAL_PP(assoc_array_arg); break; } - ta = php_localtime_r(×tamp, &tmbuf); + if (NULL == (ta = php_localtime_r(×tamp, &tmbuf))) { + php_error(E_WARNING, "%s(): invalid local time", + get_active_function_name(TSRMLS_C)); + RETURN_FALSE; + } if (array_init(return_value) == FAILURE) { php_error(E_ERROR, "Cannot prepare return array from localtime"); RETURN_FALSE; |