PHP 4.0 Bug #4887: memory corruption

From: Date: Thu, 08 Jun 2000 08:22:34 +0000
Subject: PHP 4.0 Bug #4887: memory corruption
Groups: php.dev 
Request: Send a blank email to php-dev+get-20542@lists.php.net to get a copy of this message
From: websupport@silyn-tek.de Operating system: linux 2.2.14 PHP version: 4.0.0 Release PHP Bug Type: MSSQL related Bug description: memory corruption sorry for creating new bugthread, lost my userid, but please try this out <?php ## here is a complete listing ## please create a database emerald ## go to an empty directory and start with # rm *;while true ; do wget http://ts/test/test.php;done ## after getting about 1000 files do # for i in *; do echo -n "$i:";diff -a test.php $i; ## why do so many files differ and contain binary data ????? function print_array($a) { while (list ($key, $val) = each ($a)) { echo "$key\t$val\n"; };}; function create_table() { $r=mssql_query("drop table bugs"); $r=mssql_query("drop table bugsb"); $r=mssql_query("create table bugs (FIRSTNAME char(20),LASTNAME char(20),COMPANY char(20), COMMENTS char(20), CUSTOMERID integer)"); $r=mssql_query("insert bugs values ('rainer','zufall','dusty','hallo',35800)"); $r=mssql_query("create table bugsb (MAIDENNAME char(20),ACCOUNTTYPE char(20), CUSTOMERID integer)"); $r=mssql_query("insert bugsb values ('geheim','surf20',35800)"); }; function fetch_cid($cid) { $fields="FIRSTNAME,LASTNAME,COMPANY,COMMENTS"; $res=array("a"=>"b"); $r=mssql_query("select $fields from bugs where CUSTOMERID=$cid"); if($r>0) { $ma=mssql_fetch_array($r); mssql_free_result($r); $res["FIRSTNAME"]=$ma["FIRSTNAME"]; $res["LASTNAME"]=$ma["LASTNAME"]; $res["COMPANY"]=$ma["COMPANY"]; $res["COMMENTS"]=$ma["COMMENTS"]; }; $res["VAT"]=0; $r=mssql_query("select * from bugsb where CUSTOMERID=$cid"); if($r>0) { $sa=mssql_fetch_array($r); mssql_free_result($r); }; $com=$res["COMMENTS"]; if(preg_match("/^(.*?):/",$com,$parts)) { echo "i never get here, but thats ok"; }; $testres["MAIDENNAME"]=$sa["MAIDENNAME"]; $x=$sa["MAIDENNAME"]; $x="geheim"; $res["MAIDENNAME"]=$x; $res["EMAIL"]="email"; $y=$sa["ACCOUNTTYPE"]; $res["TARIF"]=$y; print_array($res); return $res; }; $dbi=mssql_connect ("mssql","silyndb","nosilyndb"); create_table(); $u=fetch_cid(35800); echo "\n"; print_array($u); mssql_close($dbi); ?>

« previous php.dev (#20542) next »