Bug #12768 Updated: wordwrap crashes with 4 parameters and width=0
| From: | jimw@php.net | Date: | Fri, 04 Jan 2002 19:49:35 +0000 |
| Subject: | Bug #12768 Updated: wordwrap crashes with 4 parameters and width=0 | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-75900@lists.php.net to get a copy of this message | ||
ID: 12768
Updated by: jimw
Reported By: marc.pohl@wwf-gruppe.de
Old Status: Open
Status: Closed
Bug Type: Reproducible crash
Operating System: Linux
PHP Version: 4.0.6
Assigned To: elixer
New Comment:
forcing a cut with a zero width doesn't make any sense. but segfault
fixed in cvs and this case now issues a warning. (but also found and
fixed a related crash if a multi-character break was used with a zero
width.)
Previous Comments:
------------------------------------------------------------------------
[2001-08-15 12:00:10] marc.pohl@wwf-gruppe.de
hi,
i discovered a small bug in wordwrap. if you call this function with 4
parameters and a width of 0 your php-script will crash/timeout.
<pre>
<?php
$string = "the quick brown fox ...";
echo wordwrap($string, 0, "\n", 1),"\n";
?>
</pre>
here is an inconsistency with the 2-parameter version, which returns all
words separated by \n in this case
regards marc
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=12768&edit=1