php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20698 preg_match_all causes php to fail with "unknow software exception"
Submitted: 2002-11-28 06:26 UTC Modified: 2002-11-28 07:11 UTC
Votes:2
Avg. Score:2.5 ± 1.5
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: thingol at mail dot ru Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 4.3.0-dev OS: *
Private report: No CVE-ID: None
 [2002-11-28 06:26 UTC] thingol at mail dot ru
If the text for preg_match_all is bigger than some value, many regexp constructions causes php to terminate.

This code crashes php (on win32 only):

<?
$thi = str_repeat("aaaaaaa   a aa aa aa\n", 1000);
preg_match_all("/(.|\n)*/",$thi,$vars);
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-28 07:06 UTC] wez@php.net
Not really a PHP bug; bug is in the PCRE library itself
and is because you are asking it to capture a very large
number of individual character matches.
Increasing your stack size might help (ulimit).

 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Nov 27 22:03:15 2021 UTC