Bug #72152 [Ver->Csd]: base64_decode $strict fails to detect null byte
| From: | nikic@php.net | Date: | Tue, 05 Jul 2016 14:57:53 +0000 |
| Subject: | Bug #72152 [Ver->Csd]: base64_decode $strict fails to detect null byte | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-202075@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72152&edit=1
ID: 72152
Updated by: nikic@php.net
Reported by: vedad at kajtaz dot net
Summary: base64_decode $strict fails to detect null byte
-Status: Verified
+Status: Closed
Type: Bug
Package: *URL Functions
Operating System: FreeBSD 10.1
PHP Version: 7.0.6
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of lauri.kentta@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=260c07db850266d2d65cff446ec98d4a4752d41c
Log: base64_decode: fix bug #72152 (fail on NUL bytes in strict mode)
Previous Comments:
------------------------------------------------------------------------
[2016-05-06 14:56:47] cmb@php.net
Obviously, base64_decode(..., true) is not binary safe,
see <https://3v4l.org/H9shC>.
------------------------------------------------------------------------
[2016-05-04 10:26:57] vedad at kajtaz dot net
Description:
------------
As per documentation,
base64_decode("\x0", true)
base64_decode("\x0anything", true)
shoud return FALSE. Instead, they return an empty string.
Test script:
---------------
var_export(base64_decode("\x0", true));
echo PHP_EOL;
var_export(base64_decode("\x0anything", true));
Expected result:
----------------
false
false
Actual result:
--------------
''
''
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72152&edit=1