php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #65155 hex2bin() should behave consistent
Submitted: 2013-06-28 01:50 UTC Modified: 2013-07-08 10:40 UTC
From: yohgaki at ohgaki dot net Assigned: yohgaki (profile)
Status: Closed Package: *General Issues
PHP Version: 5.4Git-2013-06-28 (Git) OS: any
Private report: No CVE-ID: None
 [2013-06-28 01:50 UTC] yohgaki at ohgaki dot net
Description:
------------
hex2bin() returns false for invalid inputs. However, it raise E_WARNING and 
return FALSE for invalid length, but it simply returns FALSE for bad chars.

Solution:
Add E_WARING or remove them.

Since hex2bin() is not supposed to handle external input for most cases, Adding 
E_WARNING would be nicer than removing.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-28 01:50 UTC] yohgaki@php.net
-Assigned To: +Assigned To: yohgaki
 [2013-06-28 01:50 UTC] yohgaki@php.net
-Status: Assigned +Status: Open
 [2013-07-08 10:40 UTC] yohgaki@php.net
-Status: Assigned +Status: Closed
 [2013-07-08 10:40 UTC] yohgaki@php.net
Change is committed. 5.5>
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat May 03 15:01:28 2025 UTC