[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-internals
Subject:    Re: [PHP-DEV] PHP 5.2.1 crashing Apache/IIS...
From:       Stanislav Malyshev <stas () zend ! com>
Date:       2007-02-10 0:31:45
Message-ID: 45CD1271.1090704 () zend ! com
[Download RAW message or body]

> This script crashes PHP 5.2.1 everywhere.  Command-line and web server 
> (module and CGI modes).  IMO, there's a bug somewhere in str_ireplace(). 
>  But it could be also more fundamental with how Zend treats variables. 
>  All that showing data around assigning a variable to itself.

I can reproduce it. Seems to be off-by-one here:

Z_STRVAL_P(result) = target = safe_emalloc(char_count, to_len, len);

introduced by this patch:

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.36&r2=1.445.2.14.2.37
If I replace len with len+1, it seems to be OK.
-- 
Stanislav Malyshev, Zend Products Engineer
stas@zend.com  http://www.zend.com/

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic