php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39190 php dies on preg_replace
Submitted: 2006-10-18 21:01 UTC Modified: 2006-10-20 09:38 UTC
From: camka at email dot ee Assigned:
Status: Closed Package: PCRE related
PHP Version: 5.1.6 OS: win 2000
Private report: No CVE-ID: None
 [2006-10-18 21:01 UTC] camka at email dot ee
Description:
------------
preg_replace kills php with certain arguments.
Tried with latest snapshot.
Tried playing with pcre.backtrack_limit, pcre.recursion_limit. No success. 

cannot repeat on linux environment.

Reproduce code:
---------------
<?php
$query = "UPDATE cache SET data = 'a:3:{s:10:|path index|;a:84:{s:11:|admin/block|;i:-1;s:16:|admin/block/list|;i:-2;s:21:|admin/block/configure|;i:-3;s:18:|admin/block/delete|;i:-4;s:15:|admin/block/add|;i:-5;s:13:|admin/comment|;i:-6;s:18:|admin/comment/edit|;i:-7;s:20:|admin/comment/delete|;i:-8;s:18:|admin/comment/list|;i:-9;s:23:|admin/comment/configure|;i:-10;s:22:|admin/comment/list/new|;i:-11;s:27:|admin/comment/list/approval|;i:-12;s:32:|admin/comment/configure/settings|;i:-13;s:30:|admin/comment/configure/matrix|;i:-14;s:34:|admin/comment/configure/thresholds|;i:-15;s:29:|admin/comment/configure/roles|;i:-16;s:29:|admin/comment/configure/votes|;i:-17;s:12:|comment/edit|;i:-18;s:7:|comment|;i:-19;s:13:|admin/filters|;i:-20;s:20:|admin/filters/delete|;i:-21;s:11:|filter/tips|;i:-22;s:10:|admin/help|;i:-23;s:16:|admin/help/block|;i:-24;s:18:|admin/help/comment|;i:-25;s:17:|admin/help/filter|;i:-26;s:15:|admin/help/help|;i:-27;s:15:|admin/help/node|;i:-28;s:15:|admin/help/page|;i:-29;s:16:|admin/help/story|;i:-30;s:17:|admin/help/system|;i:-31;s:19:|admin/help/taxonomy|;i:-32;s:15:|admin/help/user|;i:-33;s:19:|admin/help/watchdog|;i:-34;s:10:|admin/node|;i:-35;s:17:|admin/node/action|;i:-36;s:19:|admin/node/overview|;i:-37;s:20:|admin/node/configure|;i:-38;s:29:|admin/node/configure/settings|;i:-39;s:26:|admin/node/configure/types|;i:-40;s:4:|node|;i:-41;s:8:|node/add|;i:-42;s:13:|node/add/page|;i:-43;s:14:|node/add/story|;i:-44;s:12:|system/files|;i:-45;s:11:|system/test|;i:-46;s:5:|admin|;i:-47;s:12:|admin/themes|;i:-48;s:19:|admin/themes/select|;i:-49;s:21:|admin/themes/settings|;i:-50;s:28:|admin/themes/settings/global|;i:-51;s:32:|admin/themes/settings/bluemarine|;i:-52;s:14:|admin/settings|;i:-53;s:13:|admin/m'";

echo ($q = preg_replace("/([\"'])(?:\\\\.|\\1\\1|.)*\\1/sU", "{}", $query));
?>

Expected result:
----------------
UPDATE cache SET data = {}

Actual result:
--------------
php.exe Application Error

The exception unknown software exception (0xc00000fd) occurred in the application at location 0x101432f8 ...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-18 21:03 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2006-10-20 09:38 UTC] camka at email dot ee
Works with 5.2.0RC6.
Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC