php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #436 Script execution stopped at echo(nl2br($x));
Submitted: 1998-06-03 23:12 UTC Modified: 1998-06-04 18:00 UTC
From: C dot Oldiges at tu-bs dot de Assigned: rasmus (profile)
Status: Closed Package: Reproducible Crash
PHP Version: 3.0 Release Candidate 5 OS: Linux 2.0.31 x86
Private report: No CVE-ID: None
 [1998-06-03 23:12 UTC] C dot Oldiges at tu-bs dot de
Client IE4.01 (NN4.05 works !?!?!)
Apache 126 with php as module

echo(nl2br($newtext));

This line stops script execution when the variable
$newtext is filled by a form POST from a textarea from IE401 AND the last character typed in the textarea is a RETURN.

whereas

printf(nl2br($newtext));

works !

The output is ends exactly AFTER this line.


nl2br seems to be the problem, but i can only find this:

Line 829 of functions/string.c should be

result->value.str.len = (len+(char_count*(to_len-1)))+1;

because the string gets longer by (to_len-1) for each occurence of the inchar and not by to_len, because the inchar is 1 byte long for itself.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-06-04 18:00 UTC] rasmus
Fixed - off by one error
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 19:01:31 2024 UTC