#37335 [Fbk]: zip_entry_read handling of null byte
| From: | pajoye@php.net | Date: | Fri, 05 May 2006 21:44:33 +0000 |
| Subject: | #37335 [Fbk]: zip_entry_read handling of null byte | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-96696@lists.php.net to get a copy of this message | ||
ID: 37335
Updated by: pajoye@php.net
Reported By: humbads at alum dot mit dot edu
Status: Feedback
Bug Type: ZZiplib Related
Operating System: FreeBSD 4.7 RELEASE
PHP Version: 4.4.2
Assigned To: pajoye
New Comment:
Sorry for the previous comment, a wrong snippet was selected.
My question is only: which version(s) of the zip package do you use?
Previous Comments:
------------------------------------------------------------------------
[2006-05-05 21:43:43] pajoye@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php
for Win32
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
Which version(s) of the zip package do you use?
------------------------------------------------------------------------
[2006-05-05 21:15:37] humbads at alum dot mit dot edu
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 this bug report at http://bugs.php.net/?id=37335&edit=1