|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #160 Bug ?? base64_encode and binary data
Submitted: 1998-03-11 08:32 UTC Modified: 2009-04-21 14:23 UTC
From: hf at rp-online dot de Assigned:
Status: Closed Package: *General Issues
PHP Version: 3.0b6 OS: ALL
Private report: No CVE-ID: None
 [1998-03-11 08:32 UTC] hf at rp-online dot de
In the base64_encode function the param is a string
and you determine the length with 

(from the source:)

unsigned char *base64_encode(const unsigned char *string) {
const unsigned char *current = string;
int length = strlen(string);

If you use real binary data the length is wrong if 
there is a 0x00 char somewhere in the data.

Helmut Franzke


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-03-18 16:05 UTC] zeev
Most functions are not yet binary safe in 3.0, that'll
be addressed in 3.1
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Nov 15 23:01:35 2019 UTC