php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1059 sequence of str_replace statements results in a reproducable PHP crash
Submitted: 1999-01-12 10:56 UTC Modified: 1999-01-12 11:06 UTC
From: abbaer at landsend dot com Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0.6 OS: Windows 95
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: abbaer at landsend dot com
New email:
PHP Version: OS:

 

 [1999-01-12 10:56 UTC] abbaer at landsend dot com
<?
	$baseURL="http://www.landsend.com/";
	if ($url=="") { 
    		$url=$baseURL.'spawn.cgi@ZEROPAGE&GRAPHIC&NODEPROD0795&0916064873251';
    	} else {
		#process our own query string;
		$url=substr($QUERY_STRING,strpos($QUERY_STRING,'=')+1);
	}	
	$div=strpos($url,"@");
	$url[$div]="?";
	$xf=fopen($url, "r" );
	$contents = fread( $xf, 100000 );
        fclose( $xf );

	$contents = str_replace("BACKGROUND=\"/","BACKGROUND=\"http://www.landsend.com/",$contents);
	$contents=str_replace( "IMG SRC=\"", "IMG SRC=\"http://www.landsend.com", $contents );
	$contents=str_replace( "img src=\"", "IMG SRC=\"http://www.landsend.com", $contents );
	echo $contents;
?>

addition of the third str_replace statement causes the crash.

PHP caused an invalid page fault in
module PHP.EXE at 014f:0044087a.
Registers:
EAX=000046a8 CS=014f EIP=0044087a EFLGS=00010202
EBX=69696969 SS=0157 ESP=006bec70 EBP=00d3d9f0
ECX=00000000 DS=0157 ESI=00d2d9d4 FS=13bf
EDX=00d34000 ES=0157 EDI=e8686868 GS=0000
Bytes at CS:EIP:
8b 0a 33 cb bf ff fe fe 7e 03 f9 83 f1 ff 33 cf 
Stack dump:
00e11500 00d3301c 004176bb 00d3301c 00000069 00005690 00000020 0047e4fc 006bfda8 0047e4f0 00d33064 00005690 00d3305c 0041757e 00d3d9f0 00d2d9d4 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-01-12 11:06 UTC] rasmus
Fixed in CVS
 [2022-09-13 11:59 UTC] git@php.net
Automatic comment on behalf of derickr
Revision: https://github.com/php/doc-en/commit/bc70945d852c43eb03b4235e42af868d88931993
Log: Fixed #1059: DateTime::diff Not handling DST changes correctly
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 01:01:33 2024 UTC