cellog          Mon Jun 16 04:07:00 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/phar   zip.c 
  Log:
  fix hashtable creation for zip to be exact size needed, fix endian issue for 
loading manifest
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/zip.c?r1=1.47.2.7&r2=1.47.2.8&diff_format=u
Index: php-src/ext/phar/zip.c
diff -u php-src/ext/phar/zip.c:1.47.2.7 php-src/ext/phar/zip.c:1.47.2.8
--- php-src/ext/phar/zip.c:1.47.2.7     Sun Jun 15 21:42:20 2008
+++ php-src/ext/phar/zip.c      Mon Jun 16 04:06:59 2008
@@ -254,11 +254,11 @@
        /* seek to central directory */
        php_stream_seek(fp, PHAR_GET_32(locator.cdir_offset), SEEK_SET);
        /* read in central directory */
-       zend_hash_init(&mydata->manifest, sizeof(phar_entry_info),
+       zend_hash_init(&mydata->manifest, PHAR_GET_16(locator.count),
                zend_get_hash_value, destroy_phar_manifest_entry, 
mydata->is_persistent);
-       zend_hash_init(&mydata->mounted_dirs, sizeof(char *),
+       zend_hash_init(&mydata->mounted_dirs, 5,
                zend_get_hash_value, NULL, mydata->is_persistent);
-       zend_hash_init(&mydata->virtual_dirs, sizeof(char *),
+       zend_hash_init(&mydata->virtual_dirs, PHAR_GET_16(locator.count) * 2,
                zend_get_hash_value, NULL, mydata->is_persistent);
        entry.phar = mydata;
        entry.is_zip = 1;
@@ -286,7 +286,7 @@
                        return FAILURE;
 
        /* add each central directory item to the manifest */
-       for (i = 0; i < locator.count; ++i) {
+       for (i = 0; i < PHAR_GET_16(locator.count); ++i) {
                phar_zip_central_dir_file zipentry;
 
                if (sizeof(zipentry) != php_stream_read(fp, (char *) &zipentry, 
sizeof(zipentry))) {



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

Reply via email to