]> granicus.if.org Git - php/commitdiff
MFH:- Fixed bug #48247 (Infinite loop and possible crash during startup with errors)
authorJani Taskinen <jani@php.net>
Tue, 7 Jul 2009 16:43:35 +0000 (16:43 +0000)
committerJani Taskinen <jani@php.net>
Tue, 7 Jul 2009 16:43:35 +0000 (16:43 +0000)
NEWS
main/main.c

diff --git a/NEWS b/NEWS
index b62ebac6e3dfdfb7b40986e4644e7a35fd6ace3e..a74954634140daffe555b88da3173c05a6afe3cd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,7 +26,9 @@ PHP                                                                        NEWS
 - Fixed bug #48450 (Compile failure under IRIX 6.5.30 building gd.c). (Kalle)
 - Fixed bug #48276 (date("Y") on big endian machines produces the
   wrong result). (Scott)
-- Fixed #48116 (Fixed build with Openssl 1.0). (Pierre, 
+- Fixed bug #48247 (Infinite loop and possible crash during startup with
+  errors when errors are logged). (Jani)
+- Fixed bug #48116 (Fixed build with Openssl 1.0). (Pierre, 
   Al dot Smith at aeschi dot ch dot eu dot org)
 - Fixed bug #47351 (Memory leak in DateTime). (Derick, Tobias John)
 - Fixed bug #45905 (imagefilledrectangle() clipping error).
index 85cfe1741dc6082e2277007a2482df8e8e8168b8..7337abcb846bdffa15acbcc921a5ba6332ce375c 100644 (file)
@@ -469,6 +469,20 @@ static int module_initialized = 0;
 static int module_startup = 1;
 static int module_shutdown = 0;
 
+/* {{{ php_during_module_startup */
+static int php_during_module_startup(void)
+{
+       return module_startup;
+}
+/* }}} */
+
+/* {{{ php_during_module_shutdown */
+static int php_during_module_shutdown(void)
+{
+       return module_shutdown;
+}
+/* }}} */
+
 /* {{{ php_log_err
  */
 PHPAPI void php_log_err(char *log_message TSRMLS_DC)
@@ -491,7 +505,7 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC)
                        char *error_time_str;
 
                        time(&error_time);
-                       error_time_str = php_format_date("d-M-Y H:i:s", 11, error_time, 1 TSRMLS_CC);
+                       error_time_str = php_format_date("d-M-Y H:i:s", 11, error_time, php_during_module_startup() TSRMLS_CC);
                        len = spprintf(&tmp, 0, "[%s] %s%s", error_time_str, log_message, PHP_EOL);
 #ifdef PHP_WIN32
                        php_flock(fd, 2);
@@ -540,24 +554,6 @@ PHPAPI int php_printf(const char *format, ...)
 }
 /* }}} */
 
-/* {{{ php_verror helpers */
-
-/* {{{ php_during_module_startup */
-static int php_during_module_startup(void)
-{
-       return module_startup;
-}
-/* }}} */
-
-/* {{{ php_during_module_shutdown */
-static int php_during_module_shutdown(void)
-{
-       return module_shutdown;
-}
-/* }}} */
-
-/* }}} */
-
 /* {{{ php_verror */
 /* php_verror is called from php_error_docref<n> functions.
  * Its purpose is to unify error messages and automatically generate clickable