cellog          Mon Feb 16 18:55:06 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/phar   zip.c 
  Log:
  fix memleaks on zip corruption
  
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/zip.c?r1=1.47.2.27&r2=1.47.2.28&diff_format=u
Index: php-src/ext/phar/zip.c
diff -u php-src/ext/phar/zip.c:1.47.2.27 php-src/ext/phar/zip.c:1.47.2.28
--- php-src/ext/phar/zip.c:1.47.2.27    Sun Feb 15 20:29:13 2009
+++ php-src/ext/phar/zip.c      Mon Feb 16 18:55:06 2009
@@ -480,11 +480,13 @@
                        php_stream_seek(fp, PHAR_GET_32(zipentry.offset), 
SEEK_SET);
 
                        if (sizeof(local) != php_stream_read(fp, (char *) 
&local, sizeof(local))) {
+                               pefree(entry.filename, entry.is_persistent);
                                PHAR_ZIP_FAIL("phar error: internal corruption 
of zip-based phar (cannot read local file header for alias)");
                        }
 
                        /* verify local header */
                        if (entry.filename_len != 
PHAR_GET_16(local.filename_len) || entry.crc32 != PHAR_GET_32(local.crc32) || 
entry.uncompressed_filesize != PHAR_GET_32(local.uncompsize) || 
entry.compressed_filesize != PHAR_GET_32(local.compsize)) {
+                               pefree(entry.filename, entry.is_persistent);
                                PHAR_ZIP_FAIL("phar error: internal corruption 
of zip-based phar (local head of alias does not match central directory)");
                        }
 



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

Reply via email to