php.net |  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hf at rp-online dot de
New email:
PHP Version: OS:

 

 [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.

Regards
Helmut Franzke

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC