Ticket #47 (closed defect: duplicate)

Opened 2 years ago

Last modified 2 years ago

String is not zero-terminated

Reported by: me@najk.com Assigned to: somebody
Priority: minor Milestone: 0.9.5
Component: eAccelerator Version: 0.9.5
Keywords: zero-terminated string Cc:

Description

When reloading a php script this error comes like in one of ten reloads.

Warning: String is not zero-terminated (ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZÑÌè*) (source: /build/php-5.1.2/Zend/zend_variables.h:45) in /web/reviews/index.html on line 12.

line 12 contains this: $css = "";

(using unset is not an option)

eaccellerator 0.9.5 beta 1 Apache 2.2.0 Php 5.1.2 No zend engine present or loaded in php.ini

any response whould be appriciated. /me..

Change History

04/12/06 11:57:56 changed by anonymous

Can you try the beta2 first that we released yesterday? If that doesn't work can you give us a piece of php code to reproduce this error? Als a description of the environment you are using. (OS, compiler, ...)

04/14/06 11:50:16 changed by bart

  • milestone set to 0.9.5.

04/14/06 11:52:00 changed by me@najk.com

  • status changed from new to closed.
  • resolution set to fixed.

Beta 2 seems to have solved the issue. Thanks

04/15/06 11:13:33 changed by anonymous

  • status changed from closed to reopened.
  • resolution deleted.

04/15/06 11:35:41 changed by me@najk.com

Using Beta 2 did not solve the issue. so here is some examplecode and my specs.

eAccelerator 0.9.5-beta2 PHP 5.1.2 [ZE 2.1.0] FreeBSD 5.4-RELEASE-p12 amd64 Apache/2.2.0

config file php.ini

extension="eaccelerator.so"
eaccelerator.shm_size="0"
eaccelerator.cache_dir="/tmp/eaccelerator" (/dev/ad8s1d on /tmp (ufs, local, nodev, noexec, nosuid, soft-updates))
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="300"
eaccelerator.shm_prune_period="3600"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

error:

Warning : String is not zero-terminated (ZZZZ„̏*) (source: /root/php-5.1.2/Zend/zend_variables.h:45) in /smi/web/index.php on line 4
Warning: String is not zero-terminated (°ÂÕéþ+C\v' Êè'8J]q†œ³Ëäþ5Rp¯ÀÒåù$;Sl†¡½Úø7HZm–¬ÃÛô)Eb€Ÿ¿Ðâõ 
4Kc|–±Íê'GXj}'¦¼Óë
9Ur¯Ïàò.D[sŒ¦ÁÝú7Whz¡¶Ìãû.Ie‚ ¿ßð)>Tkƒœ¶Ñí (GgxŠ±ÆÜó$>Yu'°Ïï) (source: /root/php-5.1.2/Zend/zend_variables.h:45) in /smi/web/index.php on line 15
Warning: String is not zero-terminated (ZZZZZZZZZZZZZ„̏*) (source: /root/php-5.1.2/Zend/zend_variables.h:45) in /smi/web/index.php on line 45
Warning: String is not zero-terminated (ZZZZZZZZZZZ„̏*) (source: /root/php-5.1.2/Zend/zend_variables.h:45) in /smi/web/index.php on line 58

sample script:

<?php
$charset = "utf-8";
$mime = "text/html";
$declaration = ""; #first error here
$key = "fhfghfffsxeedlo!!..sd";
$mysql_host = "localhost";
$mysql_user = "demo";
$mysql_password = "deluxe";
$my_database = "myuser";

$link = mysql_connect("$mysql_host", "$mysql_user", "$mysql_password") or $etext="Could not connect";
mysql_select_db("$my_database") or $etext="Could not select database";

$uncryptpass = $_SERVER['PHP_AUTH_PW'];
$cryptedpass = "{md5}" . trim(str_replace("\n","",`/bin/echo -n $uncryptpass | openssl dgst -binary -md5 | openssl enc -base64`)); #second error here

$query = "SELECT password FROM users WHERE userid = '". $_SERVER['PHP_AUTH_USER'] ."' AND passwd = '". $cryptedpass ."' LIMIT 1;";
$query_result_handle = mysql_query ($query) or print "Could not make query";
$row = mysql_fetch_row ($query_result_handle);
mysql_close($link);
$sqltempcpwd = $row[0];


$decrypted = decrypt_md5($sqltempcpwd, $key);
$sqlpass = substr($decrypted, 0, 5);



function bytexor($a,$b,$l)
{
	$c="";
	for($i=0;$i<$l;$i++) {
	$c.=$a{$i}^$b{$i};
	}
	return($c);
}

function binmd5($val)
{
	return(pack("H*",md5($val)));
}

function decrypt_md5($msg,$heslo)
{
	$key=$heslo;$sifra=""; #third error here
	$key1=binmd5($key);
	while($msg) {
		$m=substr($msg,0,16);
		$msg=substr($msg,16);
		$sifra.=$m=bytexor($m,$key1,16);
		$key1=binmd5($key.$key1.$m);
	}
#	echo "\n";
	return($sifra);
}

function crypt_md5($msg,$heslo)
{
	$key=$heslo;$sifra=""; #fourth error here
	$key1=binmd5($key);
	while($msg) {
		$m=substr($msg,0,16);
		$msg=substr($msg,16);
		$sifra.=bytexor($m,$key1,16);
		$key1=binmd5($key.$key1.$m);
	}
#echo "\n";
return($sifra);
}
?>

04/15/06 11:38:26 changed by me@najk.com

Forgot, using compiler cc (GCC) 3.4.2 [FreeBSD] 20040728

04/15/06 12:54:43 changed by me@najk.com

I updated gcc and gmake to GNU Make 3.81 vs gcc (GCC) 4.1.0. Still the same problem though.

04/29/06 12:56:43 changed by bart

I don't see this error on Fedore FC5 with gcc 4.1 This is really strange. Can you try to make the test script make this errors without the mysql connections?

04/29/06 12:57:08 changed by bart

Ah, do you have a debug build of php?

04/30/06 16:21:25 changed by me@najk.com

I have tried without the mysql, accually Ticket #63 is the same as this. setting shm_only to 1 will stop this behavior.

I do not have a debug biuld of php, can possible get one for debug use later.

05/08/06 12:45:38 changed by bart

Do you got a smaller piece of code that reproduces this? Because I'm not able to do so.

06/26/06 18:56:43 changed by bart

  • priority changed from major to minor.

No feedback? I putting this on low priority then.

06/30/06 21:55:04 changed by anonymous

  • status changed from reopened to closed.
  • resolution set to duplicate.

06/30/06 21:56:05 changed by anonymous

Duplicate of bug 63