php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45441 count_chars() crashes if both arguments are the same reference
Submitted: 2008-07-06 23:30 UTC Modified: 2008-08-10 01:00 UTC
Votes:1
Avg. Score:2.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: victor dot stinner at haypocalc dot com Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 5.2CVS-2008-07-06 (snap) OS: *
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-07-06 23:30 UTC] victor dot stinner at haypocalc dot com
Description:
------------
count_chars() function converts the second argument ($mode) using 
convert_to_long_ex(). If $input and $mode are both a reference to 
the same variable, PHP crashs with a segfault.

Reproduce code:
---------------
<?php
$text = 'Hello World!';
$n = count_chars(&$text, &$text);
print_r($n);
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-10 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Aug 29 15:01:52 2017 UTC