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: 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: victor dot stinner at haypocalc dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 12:01:32 2025 UTC