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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: binarte at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Sat Nov 09 16:01:29 2024 UTC