Simple Char Swapping in String crashes Webserver
| From: | Jens Kisters | Date: | Thu, 30 Aug 2001 13:04:47 +0000 |
| Subject: | Simple Char Swapping in String crashes Webserver | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-65272@lists.php.net to get a copy of this message | ||
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.
--
Grüße aus dem schönen Kleve
Jens Kisters
rosomm et partner
Agentur für neue Medien GmbH
Dienstleistungszentrum am
Weißen Tor - Eingang B
Gocher Landstrasse 2
47551 Kleve / Bedburg-Hau
Telefon: 02821 - 97856-20
Telefax: 02821 - 97856-77
j.kisters@rosomm-partner.de
http://www.rosomm-partner.de