php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24312 Base64 decoder doesn't ignore all input characters that it should ignore
Submitted: 2003-06-24 04:46 UTC Modified: 2003-06-24 10:26 UTC
From: gereon dot steffens at onvista dot de Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 4.3.3RC1 OS: All
Private report: No CVE-ID:
 [2003-06-24 04:46 UTC] gereon dot steffens at onvista dot de
Description:
------------
ext/standard/base64.c contains a mapping array called base64_reverse_table that has 256 elements, but only 240 initializers. This means that input characters in the range 0xF0 to 0xFF map to 0 (because the compiler fills the remaining elements) instead of -1 and therefore are not ignored as they should be.

Here's a diff for the trivial patch:

*** base64.c.orig       Tue Jun 24 11:01:32 2003
--- base64.c    Tue Jun 24 11:02:26 2003
***************
*** 48,53 ****
--- 48,54 ----
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+       -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
  };
  /* }}} */



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-24 10:26 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Mon Apr 21 07:02:06 2014 UTC