dmitry          Tue Aug 22 12:04:53 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src    NEWS 
    /php-src/sapi/cli   php_cli.c 
  Log:
  Fixed bug #38543 (shutdown_executor() may segfault when memory_limit is too 
low).
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.213&r2=1.2027.2.547.2.214&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.213 php-src/NEWS:1.2027.2.547.2.214
--- php-src/NEWS:1.2027.2.547.2.213     Tue Aug 22 06:15:26 2006
+++ php-src/NEWS        Tue Aug 22 12:04:53 2006
@@ -1,6 +1,8 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? Sep 2006, PHP 5.2.0
+- Fixed bug #38543 (shutdown_executor() may segfault when memory_limit is too
+  low). (Dmitry)
 - Fixed bug #38535 (memory corruption in pdo_pgsql driver on error retrieval
   inside a failed query executed via query() method). (Ilia)
 - Fixed bug #38524 (strptime() does not initialize the internal date storage
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.129.2.13.2.6&r2=1.129.2.13.2.7&diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.129.2.13.2.6 
php-src/sapi/cli/php_cli.c:1.129.2.13.2.7
--- php-src/sapi/cli/php_cli.c:1.129.2.13.2.6   Tue Jun 27 08:27:10 2006
+++ php-src/sapi/cli/php_cli.c  Tue Aug 22 12:04:53 2006
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_cli.c,v 1.129.2.13.2.6 2006/06/27 08:27:10 tony2001 Exp $ */
+/* $Id: php_cli.c,v 1.129.2.13.2.7 2006/08/22 12:04:53 dmitry Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -585,6 +585,7 @@
        char *script_file=NULL;
        int interactive=0;
        int module_started = 0;
+       int request_started = 0;
        int lineno = 0;
        char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, 
*exec_end=NULL;
        const char *param_error=NULL;
@@ -711,6 +712,7 @@
                                if (php_request_startup(TSRMLS_C)==FAILURE) {
                                        goto err;
                                }
+                               request_started = 1;
                                php_cli_usage(argv[0]);
                                php_end_ob_buffers(1 TSRMLS_CC);
                                exit_status=0;
@@ -720,6 +722,7 @@
                                if (php_request_startup(TSRMLS_C)==FAILURE) {
                                        goto err;
                                }
+                               request_started = 1;
                                php_print_info(0xFFFFFFFF TSRMLS_CC);
                                php_end_ob_buffers(1 TSRMLS_CC);
                                exit_status=0;
@@ -729,6 +732,7 @@
                                if (php_request_startup(TSRMLS_C)==FAILURE) {
                                        goto err;
                                }
+                               request_started = 1;
                                php_printf("[PHP Modules]\n");
                                print_modules(TSRMLS_C);
                                php_printf("\n[Zend Modules]\n");
@@ -743,6 +747,7 @@
                                        goto err;
                                }
 
+                               request_started = 1;
                                php_printf("PHP %s (%s) (built: %s %s) 
%s\nCopyright (c) 1997-2006 The PHP Group\n%s",
                                        PHP_VERSION, sapi_module.name, 
__DATE__, __TIME__,
 #if ZEND_DEBUG && defined(HAVE_GCOV)
@@ -993,10 +998,10 @@
                if (php_request_startup(TSRMLS_C)==FAILURE) {
                        *arg_excp = arg_free;
                        fclose(file_handle.handle.fp);
-                       php_request_shutdown((void *) 0);
                        PUTS("Could not startup.\n");
                        goto err;
                }
+               request_started = 1;
                CG(start_lineno) = lineno;
                *arg_excp = arg_free; /* reconstuct argv */
 
@@ -1247,7 +1252,9 @@
        } zend_end_try();
 
 out:
-       php_request_shutdown((void *) 0);
+       if (request_started) {
+               php_request_shutdown((void *) 0);
+       }
        if (exit_status == 0) {
                exit_status = EG(exit_status);
        }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to