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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 10:01:29 2025 UTC