Bug #72152 [Opn->Ver]: base64_decode $strict fails to detect null byte

From: Date: Fri, 06 May 2016 14:56:47 +0000
Subject: Bug #72152 [Opn->Ver]: base64_decode $strict fails to detect null byte
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200929@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: cmb@php.net Reported by: vedad at kajtaz dot net Summary: base64_decode $strict fails to detect null byte -Status: Open +Status: Verified Type: Bug Package: *URL Functions Operating System: FreeBSD 10.1 PHP Version: 7.0.6 Block user comment: N Private report: N New Comment: Obviously, base64_decode(..., true) is not binary safe, see <https://3v4l.org/H9shC>. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#200929) next »