php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40241 PHP crashes sometimes, when first parameter of strcspn is empty
Submitted: 2007-01-25 20:48 UTC Modified: 2007-01-26 12:09 UTC
From: markus at dix dot at Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.2.0 OS: Linux
Private report: No CVE-ID: None
 [2007-01-25 20:48 UTC] markus at dix dot at
Description:
------------
PHP crashes sometimes, when first parameter of strcspn is empty (string with length zero).

Example: see http://bugs.typo3.org/view.php?id=4678

Maybe this bug is related to bug #39032 (strcspn stops on null character)?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-25 20:51 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2007-01-26 12:04 UTC] markus at dix dot at
I am very sorry, I cannot extract the code that reproduces the crash. It only happens in the context of TYPO3 (see http://bugs.typo3.org/view.php?id=4678).

Using TYPO3, editing a "tt_news" Plugin results in an empty page. Tracing the error, the strcspn statement crashes. Extracting the block of code and executing it with the same parameters, everything works fine.
 [2007-01-26 12:09 UTC] tony2001@php.net
We cannot fix something we can't reproduce, sorry.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 13:01:36 2024 UTC