pajoye          Sun, 19 Jul 2009 15:32:09 +0000

URL: http://svn.php.net/viewvc?view=revision&revision=284364

Changed paths:
        U   php/php-src/branches/PHP_5_3/ext/zip/lib/zip_close.c

Log:
- MFB: Fix #48763, create corrupt archive

Modified: php/php-src/branches/PHP_5_3/ext/zip/lib/zip_close.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/zip/lib/zip_close.c        2009-07-19 
15:31:05 UTC (rev 284363)
+++ php/php-src/branches/PHP_5_3/ext/zip/lib/zip_close.c        2009-07-19 
15:32:09 UTC (rev 284364)
@@ -175,6 +175,7 @@
                    de.filename = strdup("-");
                    de.filename_len = 1;
                    cd->entry[j].filename = "-";
+                   cd->entry[j].filename_len = 1;
                }
                else {
                    de.filename = strdup(za->cdir->entry[i].filename);
@@ -195,13 +196,15 @@
                error = 1;
                break;
            }
+           memcpy(cd->entry+j, za->cdir->entry+i, sizeof(cd->entry[j]));
+
            if (de.bitflags & ZIP_GPBF_DATA_DESCRIPTOR) {
                de.crc = za->cdir->entry[i].crc;
                de.comp_size = za->cdir->entry[i].comp_size;
                de.uncomp_size = za->cdir->entry[i].uncomp_size;
                de.bitflags &= ~ZIP_GPBF_DATA_DESCRIPTOR;
+           cd->entry[j].bitflags &= ~ZIP_GPBF_DATA_DESCRIPTOR;
                }
-           memcpy(cd->entry+j, za->cdir->entry+i, sizeof(cd->entry[j]));
        }

        if (za->entry[i].ch_filename) {

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

Reply via email to