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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
41 - 7 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 23:01:34 2024 UTC