Base64 decoder doesn't ignore all input characters that it should ignore
| 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: | None | ||
[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
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2003-06-24 10:26 UTC] iliaa@php.net