php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13089 Simple Char Swapping in String crashes Webserver
Submitted: 2001-09-01 09:50 UTC Modified: 2001-10-25 06:31 UTC
From: j dot kisters at rosomm-partner dot de Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4.0.4pl1 OS: Suse Linux 7.1
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: j dot kisters at rosomm-partner dot de
New email:
PHP Version: OS:

 

 [2001-09-01 09:50 UTC] j dot kisters at rosomm-partner dot de
Hey there i just managed something that i never accomplished beforei
kill a httpd process from PHP,
i run the following code

<?
  $slen=strlen($enc);
  for ($i=0;$i<$slen;$i=$i+2) {
   $swap=$enc[$i];
   $enc[$i]=$enc[$i+1];
   $enc[$i+1]=$swap;
  }
?>

$enc is a string and has an even length

This silly lines of code make the apache child process crash, if i
change it to

<?
  $slen=strlen($enc);
  for ($i=0;$i<$slen;$i=$i+2) {
   $swap=$enc[$i];
   $swap2=$enc[$i+1];
   $enc[$i]=$swap2;
   $enc[$i+1]=$swap;
  }
?>

it works well.
what the hell is happening here?

i run php 4.04pl1 as apache module under linux.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-05 12:37 UTC] rasmus@php.net
Unable to reproduce this.  Could you check to see if this is still a problem in recent versions?
 [2001-10-25 06:31 UTC] sander@php.net
No feedback. Closing.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 12:01:27 2024 UTC