PHP :: Bug #60569 :: Nullbyte truncates Exception $message.
| Bug #60569 | Nullbyte truncates Exception $message. | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2011-12-20 04:17 UTC | Modified: | 2012-04-20 01:40 UTC |
|
||||||||||
| From: | hanskrentel at yahoo dot de | Assigned: | iliaa (profile) | |||||||||||
| Status: | Closed | Package: | Scripting Engine problem | |||||||||||
| PHP Version: | 5.3.8 | OS: | Fedora 14 | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2011-12-20 04:17 UTC] hanskrentel at yahoo dot de
Description:
------------
When an Exception class is instantiated and a string contain a nullbyte character ("\0") is used as $message, Exception::getMessage() returns a truncated string (the protected member Exception::$message is truncated as well).
Looks like a duplicate of https://bugs.php.net/bug.php?id=50085 which outlined this as documentation problem. No idea why this is a documentation problem.
Test script:
---------------
$e = new Exception("test\0me");
echo $e->getMessage();
Expected result:
----------------
output (not displaying non-printable characters):
testme
Actual result:
--------------
output (not displaying non-printable characters):
test
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2012-03-11 18:15 UTC] iliaa@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: iliaa
[2012-03-14 10:52 UTC] hanskrentel at yahoo dot de
[2012-03-19 11:50 UTC] hanskrentel at yahoo dot de
-Status: Closed +Status: Assigned
[2012-03-19 11:50 UTC] hanskrentel at yahoo dot de
[2012-04-20 01:40 UTC] felipe@php.net