[PHP-DEV] Bug #13089: Simple Char Swapping in String crashes Webserver From: j.kisters <email protected>
Date: 09/01/01

From: j.kisters <email protected>
Operating system: Suse Linux 7.1
PHP version: 4.0.4pl1
PHP Bug Type: Reproducible crash
Bug description: Simple Char Swapping in String crashes Webserver

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.

-- 
Edit bug report at: http://bugs.php.net/?id=13089&edit=1

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>