php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27216 parsing crashes on texts longer than 3799 chars
Submitted: 2004-02-10 21:03 UTC Modified: 2004-02-11 05:13 UTC
From: list at fredfred dot net Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 4.3.4 OS: Linux,Windows XP
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: list at fredfred dot net
New email:
PHP Version: OS:

 

 [2004-02-10 21:03 UTC] list at fredfred dot net
Description:
------------
When I try use preg_match_all( $regexp, $a, $vysl);
it crashes when $a contains text in format like in file here: http://www.contipromotor.cz/download/phpBug3800chars.htm.
Basically it contains 'abbba(3799 times char s or \r\n)xa'
 Just delete the last 'x' and it works fine.

Reproduce code:
---------------
$a = I read content of file http://www.contipromotor.cz/download/phpBug3800chars.htm

$regexp = "/a(.*)a((?:.|\n)*?)a/i";

if(preg_match_all( $regexp, $a, $vysl))
  echo "found";
else
  echo "not found";

Expected result:
----------------
"found" or "not found"

Actual result:
--------------
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-11 05:13 UTC] sniper@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

You should also have searched the bug database for previous reports about this same issue. (there are dozens of them!)

This is PCRE limit you're hitting, not PHP bug.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 05:01:28 2024 UTC