php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1596 base64_decode violates rfc2045
Submitted: 1999-06-24 12:16 UTC Modified: 1999-06-24 13:07 UTC
From: bfranklin at dct dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.9 OS: Solaris 2.7
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: bfranklin at dct dot com
New email:
PHP Version: OS:

 

 [1999-06-24 12:16 UTC] bfranklin at dct dot com
base64_decode doesn't properly ignore characters that aren't in base64_table.

Here's a patch to fix the problem.

--- base64.c.orig       Sat Feb 27 10:11:08 1999
+++ base64.c    Thu Jun 24 11:04:31 1999
@@ -97,10 +97,7 @@
        while ((ch = *current++) != '\0') {
                if (ch == base64_pad) break;
                chp = strchr(base64_table, ch);
-               if (chp == NULL) {
-                       efree(result);
-                       return NULL;
-               }
+               if (chp == NULL) continue;
                ch = chp - base64_table;
 
                switch(i % 4) {

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-24 13:07 UTC] sas at cvs dot php dot net
Thanks for the patch - applied.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 03:01:29 2024 UTC