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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 13:01:30 2024 UTC