|  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
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
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
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:
$text = 'Hello World!';
$n = count_chars(&$text, &$text);


Add a Patch

Pull Requests

Add a Pull Request


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-2024 The PHP Group
All rights reserved.
Last updated: Sat Mar 02 04:01:28 2024 UTC