php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53737 segfault / php crash on nl2br(object)
Submitted: 2011-01-13 14:58 UTC Modified: 2011-01-14 12:33 UTC
From: martin at veverka dot eu Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.3.5 OS: gentoo 1.12.14, FreeBSD 8.0
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: martin at veverka dot eu
New email:
PHP Version: OS:

 

 [2011-01-13 14:58 UTC] martin at veverka dot eu
Description:
------------
Calling nl2br(any_object) causes segmentation fault and crashing php.

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

// any object
echo nl2br(new mysqli());


Expected result:
----------------
fatal error is expected

Catchable fatal error: Object of class mysqli could not be converted to string in - on line 3

Actual result:
--------------
segfault and php crash

dmesg shows this:
[12476.986676] php-cgi[21195]: segfault at 3118 ip 00007ff86c5d6074 sp 00007fff1edd4e60 error 4 in php-cgi[7ff86c26f000+77e000]

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-13 15:58 UTC] cataphract@php.net
-Status: Open +Status: Feedback
 [2011-01-13 15:58 UTC] cataphract@php.net
I can't reproduce:

$ ~/php/php5.3-t/bin/php -r "echo nl2br(new mysqli);"

Warning: nl2br() expects parameter 1 to be string, object given in Command line code on line 1

I also find no problem in nl2br (all pretty standard). Can you give more details?
 [2011-01-13 23:02 UTC] martin at veverka dot eu
-Status: Feedback +Status: Closed
 [2011-01-13 23:02 UTC] martin at veverka dot eu
Seems that the segfault is caused by the object itself, I will post more details as soon as i know something. Sorry for the misleading description.
 [2011-01-14 12:33 UTC] cataphract@php.net
-Status: Closed +Status: Bogus
 [2011-01-14 12:33 UTC] cataphract@php.net
I'm closing as bogus. If you find the problem, please submit a new bug report.

Than you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 05:01:30 2024 UTC