From: humbads at alum dot mit dot edu Operating system: FreeBSD 4.7 RELEASE PHP version: 4.4.2 PHP Bug Type: ZZiplib Related Bug description: zip_entry_read handling of null byte
Description: ------------ When using zip_entry_read to decompress a zip entry containing a null byte, the function only returns data up to the first null byte in the decompressed file. Bug does not occur on PHP 5.1.2 for Windows XP. Reproduce code: --------------- <?php dl("zip.so"); // test.zip contains one file with a null byte in the middle $zipfile = zip_open("onejpg.zip"); $zipentry = zip_read($zipfile); zip_entry_open($zipfile, $zipentry); $content = zip_entry_read($zipentry, zip_entry_filesize($zipentry)); print "filesize: ".filesize("onejpg.jpg")."\n"; print "variable: "; var_dump($content); zip_entry_close($zipentry); zip_close($zipfile); ?> Expected result: ---------------- var_dump should show a string with the same length as the file size. To download onejpg.zip and onejpg.jpg, go here: http://www.somacon.com/p258.php http://www.somacon.com/p257.php Actual result: -------------- var_dump only shows length 4, which is the length up to the null byte. -- Edit bug report at http://bugs.php.net/?id=37335&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37335&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=37335&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37335&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37335&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37335&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37335&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37335&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37335&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37335&r=support Expected behavior: http://bugs.php.net/fix.php?id=37335&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37335&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37335&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37335&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37335&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37335&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37335&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37335&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37335&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37335&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37335&r=mysqlcfg