php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55620 base64_encode failure
Submitted: 2011-09-06 12:28 UTC Modified: 2015-08-02 14:53 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: pajoye@php.net Assigned: cmb (profile)
Status: Not a bug Package: Zlib related
PHP Version: 5.4SVN-2011-09-06 (SVN) OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: pajoye@php.net
New email:
PHP Version: OS:

 

 [2011-09-06 12:28 UTC] pajoye@php.net
Description:
------------
base64_decode fails (tested on windows and linux) using the following code (comes 
from a phpt for zlib)

Test script:
---------------
<?php
$original = str_repeat("hallo php",4096);
$packed = gzencode($original);
echo strlen($packed)." ".strlen($original). "\n";
if (strcmp($original, gzdecode($packed)) == 0) echo "Strings are equal";
?>


Expected result:
----------------
118 36864
Strings are equal


Actual result:
--------------
118 36864

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-06 12:30 UTC] pajoye@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=316252
Log: - use only zlib function and reported the failure with base64 in #55620
 [2011-09-06 12:30 UTC] pajoye@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=316253
Log: - use only zlib function and reported the failure with base64 in #55620
 [2011-09-07 01:37 UTC] laruence@php.net
this test passed in my environ(Linux redhat 64bit, zlib-1.2.3)
 [2012-06-24 22:33 UTC] nikic@php.net
Can this be closed?
 [2015-08-02 14:53 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2015-08-02 14:53 UTC] cmb@php.net
The former test may have failed for a single different byte,
namely byte 10. This byte gives the OS on where the compression
took place[1], so checking against a hard-coded base64 encoded
value is supposed to be volatile.

Anyway, there is no base64_encode bug.

[1] <https://tools.ietf.org/html/rfc1952#page-7>
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 08:01:29 2025 UTC