stas                                     Tue, 13 Oct 2009 19:58:59 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=289621

Log:
fix crash for bug #47627

Bug: http://bugs.php.net/47627 (Bogus) "No input file specified" causing crash
      
Changed paths:
    U   php/php-src/branches/PHP_5_3/main/main.c
    U   php/php-src/trunk/main/main.c

Modified: php/php-src/branches/PHP_5_3/main/main.c
===================================================================
--- php/php-src/branches/PHP_5_3/main/main.c    2009-10-13 18:39:00 UTC (rev 
289620)
+++ php/php-src/branches/PHP_5_3/main/main.c    2009-10-13 19:58:59 UTC (rev 
289621)
@@ -649,6 +649,10 @@
        char *message;
        int is_function = 0;

+       if(!ZEND_CAN_REPORT(type)) {
+               return;
+       }
+
        /* get error text into buffer and escape for html if necessary */
        buffer_len = vspprintf(&buffer, 0, format, args);
        if (PG(html_errors)) {
@@ -836,6 +840,9 @@
        char *params;
        va_list args;

+       if(!ZEND_CAN_REPORT(type)) {
+               return;
+       }
        spprintf(&params, 0, "%s,%s", param1, param2);
        va_start(args, format);
        php_verror(docref, params ? params : "...", type, format, args 
TSRMLS_CC);
@@ -2164,7 +2171,9 @@
                char realfile[MAXPATHLEN];

 #ifdef PHP_WIN32
-               UpdateIniFromRegistry(primary_file->filename TSRMLS_CC);
+               if(primary_file->filename) {
+                       UpdateIniFromRegistry(primary_file->filename TSRMLS_CC);
+               }
 #endif

                PG(during_request_startup) = 0;
@@ -2254,7 +2263,9 @@

        zend_try {
 #ifdef PHP_WIN32
-               UpdateIniFromRegistry(primary_file->filename TSRMLS_CC);
+               if(primary_file->filename) {
+                       UpdateIniFromRegistry(primary_file->filename TSRMLS_CC);
+               }
 #endif

                PG(during_request_startup) = 0;

Modified: php/php-src/trunk/main/main.c
===================================================================
--- php/php-src/trunk/main/main.c       2009-10-13 18:39:00 UTC (rev 289620)
+++ php/php-src/trunk/main/main.c       2009-10-13 19:58:59 UTC (rev 289621)
@@ -2283,7 +2283,9 @@
                char realfile[MAXPATHLEN];

 #ifdef PHP_WIN32
-               UpdateIniFromRegistry(primary_file->filename TSRMLS_CC);
+               if(primary_file->filename) {
+                       UpdateIniFromRegistry(primary_file->filename TSRMLS_CC);
+               }
 #endif

                PG(during_request_startup) = 0;
@@ -2372,7 +2374,9 @@

        zend_try {
 #ifdef PHP_WIN32
-               UpdateIniFromRegistry(primary_file->filename TSRMLS_CC);
+               if(primary_file->filename) {
+                       UpdateIniFromRegistry(primary_file->filename TSRMLS_CC);
+               }
 #endif

                PG(during_request_startup) = 0;

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

Reply via email to