]> granicus.if.org Git - php/commitdiff
- Fix crash with invalid localtime on Win32 systems.
authorMarkus Fischer <mfischer@php.net>
Sun, 20 Jan 2002 20:16:54 +0000 (20:16 +0000)
committerMarkus Fischer <mfischer@php.net>
Sun, 20 Jan 2002 20:16:54 +0000 (20:16 +0000)
ext/standard/datetime.c

index fe9b01d28352195c2c740db6c146738a9c8be82b..63d3bafe2d196ed9ad378eca3b2d60aafc14a1d6 100644 (file)
@@ -586,7 +586,11 @@ PHP_FUNCTION(localtime)
                        assoc_array = Z_LVAL_PP(assoc_array_arg);
                        break;
        }
-       ta = php_localtime_r(&timestamp, &tmbuf);
+       if (NULL == (ta = php_localtime_r(&timestamp, &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;