]> granicus.if.org Git - php/commitdiff
protect against further surprises by initializing all zend_file_handle's
authorSascha Schumann <sas@php.net>
Sat, 17 May 2003 08:06:53 +0000 (08:06 +0000)
committerSascha Schumann <sas@php.net>
Sat, 17 May 2003 08:06:53 +0000 (08:06 +0000)
17 files changed:
sapi/aolserver/aolserver.c
sapi/apache/mod_php4.c
sapi/apache/sapi_apache.c
sapi/apache2filter/sapi_apache2.c
sapi/apache2handler/sapi_apache2.c
sapi/caudium/caudium.c
sapi/cgi/cgi_main.c
sapi/cli/php_cli.c
sapi/isapi/php4isapi.c
sapi/nsapi/nsapi.c
sapi/phttpd/phttpd.c
sapi/pi3web/pi3web_sapi.c
sapi/roxen/roxen.c
sapi/servlet/servlet.c
sapi/thttpd/thttpd.c
sapi/tux/php_tux.c
sapi/webjames/webjames.c

index 665dd4190c15972e9258cdc6557c00a76436d196..ea2f2ab593468adcb433325cdb3f0cba7e9af727 100644 (file)
@@ -404,7 +404,7 @@ static sapi_module_struct aolserver_sapi_module = {
 static int
 php_ns_module_main(TSRMLS_D)
 {
-       zend_file_handle file_handle;
+       zend_file_handle file_handle = {0};
 
        file_handle.type = ZEND_HANDLE_FILENAME;
        file_handle.filename = SG(request_info).path_translated;
index d5f59b21d2aab5b952224cdd414a3b0bd9aa2355..a0cbee47fd9b2637e8b6d1402c075b3f68b2b3d7 100644 (file)
@@ -534,7 +534,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
        TSRMLS_FETCH();
 
        if (AP(in_request)) {
-               zend_file_handle fh;
+               zend_file_handle fh = {0};
 
                fh.filename = r->filename;
                fh.opened_path = NULL;
index 8b651de012788f47a563bb35179efd8d6911a1ec..3075f25d8fe2dd41473a97350e3cdd0760d325c9 100644 (file)
@@ -28,7 +28,7 @@
 int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC)
 {
        int retval = OK;        
-       zend_file_handle file_handle;
+       zend_file_handle file_handle = {0};
 
        if (php_request_startup(TSRMLS_C) == FAILURE) {
                return FAILURE;
index 0d7eabb0da46885d62bdc91e65f82f190aed3084..a84052a09280f09e6320d770b0ef2f0239702a14 100644 (file)
@@ -445,7 +445,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
        }
 
        for (b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = APR_BUCKET_NEXT(b)) {
-               zend_file_handle zfd;
+               zend_file_handle zfd = {0};
 
                if (!ctx->request_processed && APR_BUCKET_IS_FILE(b)) {
                        const char *path;
index eef5669b1d0d56ecafb6cdbfcad44d97d2567a86..b6492db8d54a08425ef22a0b89f627e182ff16a0 100644 (file)
@@ -507,7 +507,7 @@ static int php_handler(request_rec *r)
                php_get_highlight_struct(&syntax_highlighter_ini);
                highlight_file((char *)r->filename, &syntax_highlighter_ini TSRMLS_CC);
        } else {
-               zend_file_handle zfd;
+               zend_file_handle zfd = {0};
 
                zfd.type = ZEND_HANDLE_FILENAME;
                zfd.filename = (char *) r->filename;
index 6b61060c88e1f2a2692698a6bdd10a2c4930ae91..1914430638e375366859c5d5b65eb602535aa748 100644 (file)
@@ -564,7 +564,7 @@ static sapi_module_struct caudium_sapi_module = {
 static void php_caudium_module_main(php_caudium_request *ureq)
 {
   int res;
-  zend_file_handle file_handle;
+  zend_file_handle file_handle = {0};
 #ifndef USE_PIKE_LEVEL_THREADS
   struct thread_state *state;
   extern struct program *thread_id_prog;
index bf7a33b9232253ddfb1e85558d04b8facc1419a8..34140b9516fb6dcd8da97ffdddae80fc5a65ba36 100644 (file)
@@ -894,7 +894,7 @@ int main(int argc, char *argv[])
 {
        int exit_status = SUCCESS;
        int cgi = 0, c, i, len;
-       zend_file_handle file_handle;
+       zend_file_handle file_handle = {0};
        int retval = FAILURE;
        char *s;
 /* temporary locals */
index 8937cc6edd3c7004a2069b1d9e7bd29814ceba66..93515b549b43247b70e545e02e3fc5dac6ebc2f0 100644 (file)
@@ -438,7 +438,7 @@ int main(int argc, char *argv[])
 {
        int exit_status = SUCCESS;
        int c;
-       zend_file_handle file_handle;
+       zend_file_handle file_handle = {0};
 /* temporary locals */
        int behavior=PHP_MODE_STANDARD;
        int no_headers=1;
index fc8f5d96677a4de3c2a0d642eb36a42c2208b504..88d95ebdafbe9d60fc3ab40e98aa47f8d392e2cd 100644 (file)
@@ -717,7 +717,7 @@ BOOL exceptionhandler(LPEXCEPTION_POINTERS *e, LPEXCEPTION_POINTERS ep)
 
 DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB)
 {
-       zend_file_handle file_handle;
+       zend_file_handle file_handle = {0};
        zend_bool stack_overflown=0;
 #ifdef PHP_ENABLE_SEH
        LPEXCEPTION_POINTERS e;
index a9ed176d6da65186a62f9fafa3c6c8204f188365..d3d1bb1d8de42cfcfea9320e76dfbdfcb31d2ae5 100644 (file)
@@ -493,7 +493,7 @@ static void nsapi_request_dtor(NSLS_D TSRMLS_DC)
 
 int nsapi_module_main(NSLS_D TSRMLS_DC)
 {
-       zend_file_handle file_handle;
+       zend_file_handle file_handle = {0};
 
        if (php_request_startup(TSRMLS_C) == FAILURE) {
                return FAILURE;
index 1928b6060e5cb173279e8628a8a694debdd9365a..0e662856bdc04127aed52b05b1af28502c52ce0d 100644 (file)
@@ -247,7 +247,7 @@ php_phttpd_request_dtor(TSRMLS_D TSRMLS_DC)
 int php_doit(TSRMLS_D TSRMLS_DC)
 {
        struct stat sb;
-       zend_file_handle file_handle;
+       zend_file_handle file_handle = {0};
        struct httpinfo *hip = PHG(cip)->hip;
        TSRMLS_FETCH();
 
index 43f784d5340cf372d3824f45159af1174008aba1..09bb892777f1b1fe9c08c5473ffc25ffd066709c 100644 (file)
@@ -387,7 +387,7 @@ static sapi_module_struct pi3web_sapi_module = {
 
 DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB)
 {
-       zend_file_handle file_handle;
+       zend_file_handle file_handle = {0};
        int iRet = PIAPI_COMPLETED;
        TSRMLS_FETCH();
 
index 855e1e90b3e3109a70860abbe340a3ab86e99c8f..d0e5501cce417375e5573fe616c9b966859ee4ca 100644 (file)
@@ -575,7 +575,7 @@ static int php_roxen_module_main(TSRMLS_D)
 {
   int res, len;
   char *dir;
-  zend_file_handle file_handle;
+  zend_file_handle file_handle = {0};
 #ifdef ROXEN_USE_ZTS
   GET_THIS();
 #endif
index c4fceba25243295d11cbf6b93991286ffe336e02..b3bcd3fe208fb5c9b2b57388e64733d0e1a1e4dc 100644 (file)
@@ -310,7 +310,7 @@ JNIEXPORT void JNICALL Java_net_php_servlet_send
         jstring contentType, jint contentLength, 
         jstring authUser, jboolean display_source_mode)
 {
-       zend_file_handle file_handle;
+       zend_file_handle file_handle = {0};
        int retval;
 #ifndef VIRTUAL_DIR
        char cwd[MAXPATHLEN];
index 48054c4394999df86c31207fd68ce9d07ec8c45d..344962921a60e86f0db9c741a39bd29db2b28489 100644 (file)
@@ -388,7 +388,7 @@ static sapi_module_struct thttpd_sapi_module = {
 
 static void thttpd_module_main(int show_source TSRMLS_DC)
 {
-       zend_file_handle file_handle;
+       zend_file_handle file_handle = {0};
 
        if (php_request_startup(TSRMLS_C) == FAILURE) {
                return;
index 7db243773c7408408d2b19ee4048666260d2095a..093e3326cf1019ca1d69cf82778ce49a9f675d91 100644 (file)
@@ -296,7 +296,7 @@ static sapi_module_struct tux_sapi_module = {
 
 static void tux_module_main(TSRMLS_D)
 {
-       zend_file_handle file_handle;
+       zend_file_handle file_handle = {0};
 
        file_handle.type = ZEND_HANDLE_FILENAME;
        file_handle.filename = SG(request_info).path_translated;
index 75a55b79c59aaf652b446bbb5a1915c2b0ecd917..06e9adb59b9721c6add6ddd931073438a68945a6 100644 (file)
@@ -142,7 +142,7 @@ static void sapi_webjames_register_variables(zval *track_vars_array TSRMLS_DC)
 
 static void webjames_module_main(TSRMLS_D)
 {
-       zend_file_handle file_handle;
+       zend_file_handle file_handle = {0};
        FILE *fp=NULL;
        char *path;