php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1666 ereg_replace causes a segfault
Submitted: 1999-07-06 01:18 UTC Modified: 1999-07-07 13:18 UTC
From: rsteffen at ia dot net Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0.11 OS: Red Hat Linux 6.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rsteffen at ia dot net
New email:
PHP Version: OS:

 

 [1999-07-06 01:18 UTC] rsteffen at ia dot net
The following script causes PHP 3.0.11 to segfault predictably.

<HTML>
<?
        $string1 = "This is a test";
        echo( "$string1<BR>" );
 
        $string2  = ereg_replace( " is", " was", $string1 );
        echo( "$string2<BR>" );
 
?>
</HTML>

Commenting out the ereg_replace stops the segfault. Works fine on 3.0.9 and 3.0.8. I can't find a copy of 3.0.10
to try it there.

Configuration:
PHP is compiled as an Apache module with the following
config:

./configure --prefix=/usr \
        --with-apxs=/usr/sbin/apxs \
        --with-config-file-path=/usr/lib \
        --enable-debug=no \
        --enable-safe-mode \
        --with-exec-dir=/usr/bin \
        --with-system-regex \
        --with-imap=imap-4.5/c-client \
        --with-sybase-ct=/opt/sybase \
        --with-ldap=yes \
        --enable-track-vars \
        --enable-debugger \
        --enable-sysvsem \
        --enable-sysvshm \
        --with-yp \
        --with-zlib \
        --with-db2 \
        --with-gdbm                                                             

I am working on a stack trace, but apache isn't cooperating tonight.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-07-06 09:36 UTC] andrey at cvs dot php dot net
There isn't anything that would cause it to fail.  I can't reproduce this.
 [1999-07-07 13:18 UTC] rasmus at cvs dot php dot net
There is a bug in the hsregex detection code in the apxs install in 3.0.11.
Undo this change:

http://cvs.php.net/cvsweb.cgi/configure.in.diff?r1=1.412&r2=1.413&f=h

then run autoconf and rebuild PHP
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 22:01:28 2024 UTC