Chase down some 64bit dragons. Ensure that we only ever create a 32bit number to compare to the 32bit magic number when searching a zip file for the end of the directory record. See #6236.

git-svn-id: https://develop.svn.wordpress.org/trunk@7314 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2008-03-15 18:33:16 +00:00
parent 0d07e27f8e
commit 9b3aab6c0d

View File

@ -4470,7 +4470,9 @@
$v_byte = @fread($this->zip_fd, 1);
// ----- Add the byte
$v_bytes = ($v_bytes << 8) | Ord($v_byte);
// Note we mask the old value down such that once shifted we can never end up with more than a 32bit number
// Otherwise on systems where we have 64bit integers the check below for the magic number will fail.
$v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte);
// ----- Compare the bytes
if ($v_bytes == 0x504b0506)