Bug #74999 [NEW]: Exception::__toString truncates message at null byte

From: Date: Fri, 28 Jul 2017 03:58:54 +0000
Subject: Bug #74999 [NEW]: Exception::__toString truncates message at null byte
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210380@lists.php.net to get a copy of this message
From:             nobots dot nospam at example dot org
Operating system: 
PHP version:      Irrelevant
Package:          *General Issues
Bug Type:         Bug
Bug description:Exception::__toString truncates message at null byte

Description:
------------
Exception's message as string is truncated at the first occurrence of a
null byte, notably a problem when anonymous classes are involved, as
their name does contain a null byte

thanks

Test script:
---------------
echo new Exception("XXXX " . get_class(new class{}) . " YYYY");

Expected result:
----------------
Exception: XXXX class@anonymous... YYYY in file:3
Stack trace:
#0 {main}

Actual result:
--------------
Exception: XXXX class@anonymous in /in/mft0e:3
Stack trace:
#0 {main}

-- 
Edit bug report at https://bugs.php.net/bug.php?id=74999&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=74999&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=74999&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=74999&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=74999&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=74999&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=74999&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=74999&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=74999&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=74999&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=74999&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=74999&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=74999&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=74999&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74999&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=74999&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=74999&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=74999&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74999&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=74999&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=74999&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#210380) next »