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
 [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: Fri Apr 19 01:01:28 2024 UTC