php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61804 trigger_error() truncates at \0
Submitted: 2012-04-21 23:31 UTC Modified: 2012-04-22 04:29 UTC
From: binarte at gmail dot com Assigned:
Status: Wont fix Package: Output Control
PHP Version: 5.4.0 OS: Linux Mint
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
19 - 4 = ?
Subscribe to this entry?

 
 [2012-04-21 23:31 UTC] binarte at gmail dot com
Description:
------------
Calls to trigger_error() gets the message truncated whenever 

Test script:
---------------
<?php

$str = 'a';
for ($x = 0; $x < 0x20; $x++){
	$str .= chr($x);	
}
$str .= 'b';

trigger_error($str);

Expected result:
----------------
Notice: a  b in /home/.../bug.php on line 9

Actual result:
--------------
Notice: a in /home/.../bug.php on line 9

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-04-21 23:33 UTC] binarte at gmail dot com
Calls to trigger_error() gets the message truncated whenever the message contains \0. Haven't tested with other characters, but I believe the bug shouldn't be much diffirint if other characters truncate the message anyway.
 [2012-04-22 04:29 UTC] laruence@php.net
-Status: Open +Status: Wont fix
 [2012-04-22 04:29 UTC] laruence@php.net
error message is null-terminated string
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 14:01:29 2024 UTC