ID: 14807
Updated by: thies
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Analyzed
Bug Type: Reproducible crash
Operating System: 
PHP Version: 4.1.0
New Comment:

your testcase can be reduced to:
<?php
$data = 
"612533413525334125374269253341312533426125334135253341253742692533413025334273253341312533412532323025323225334269253341312533427325334131253341253232302532322533426925334132253342732533413125334125323230253232253342692533413325334273253341312533412532323025323225334269253341342533427325334131253341253232302532322533422537446925334132253342612533413525334125374269253341302533427325334131253341253232302532322533426925334131253342732533413125334125323230253232253342692533413225334273253341312533412532323025323225334269253341332533427325334131253341253232302532322533426925334134253342732533413125334125323230253232253342253744692533413325334261253341352533412537426925334130253342732533413125334125323230253232253342692533413125334273253341312533412532323025323225334269253341322533427325334131253341253232302532322533426925334133253342732533413125334125323230253232253342692533413425334273253341312533412532323025323225334225374469253341342533426125334135253341253742692533413025334273253341312533412532323025323225334269253341312533427325334131253341253232302532322533426925334132253342732533413125334125323230253232253342692533413325334273253341312533412532323025323225334269253341342533427325334131253341253232302532322533422537446925334135253342612533413525334125374269253341302533427325334131253341253232302532322533426925334131253342732533413125334125323230253232253342692533413225334273253341312533412532323025323225334269253341332533427325334131253341253232302532322533426925334134253342732533413125334125323230253232253342253744253744";

$binary = base_convert($data, 16, 2);
?>

you are trying to base_convert a number with > 1500 digits. this is not going to work! 
but it shouln't crash, 
i agree. (no time to fix it right now)




Previous Comments:
------------------------------------------------------------------------

[2002-01-02 14:11:15] [EMAIL PROTECTED]

I am using it in CGI mode, and this is some info that might be useful to you:

bash$ cat /proc/version
Linux version 2.2.20 (gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)) #1 
SMP Fri Nov 9 09:25:22 EST 2001

phpinfo()

PHP Version 4.1.0
System Linux <host name removed> 2.2.20 #1 SMP Fri Nov 9 09:25:22 EST 2001 i686 
unknown
Build DateDec 24 2001
Configure Command './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml' 
'--with-curl' '--with-swf=/usr/local/flash' '--enable-ftp' '--with-gd=../gd-1.8.4' 
'--with-jpeg-dir=/usr/local' '--with-xpm-dir=/usr/X11R6' '--with-png-dir=/usr' 
'--with-imap=../imap-2001.BETA.SNAP-0105220031' '--with-ming=../ming-0.1.1' 
'--enable-magic-quotes' '--with-mysql' '--enable-safe-mode' '--enable-track-vars' 
'--with-ttf' '--enable-versioning' '--with-zlib'
Server API CGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/Zend/etc/php.ini
ZEND_DEBUG disabled
Thread Safety disabled


If you need anything else, just let me know.

------------------------------------------------------------------------

[2002-01-02 13:46:02] [EMAIL PROTECTED]

at least for me it doesn't (FreeBSD 4.4 PHP 4.1.0)
can you provide more Information about you environmation (OS, configure options e.g.) 
?


------------------------------------------------------------------------

[2002-01-02 13:39:24] [EMAIL PROTECTED]

Running the following always causes a core dump:

<?php

$arr = array (
        1 => array ("0","0","0","0","0"),
        2 => array ("0","0","0","0","0"),
        3 => array ("0","0","0","0","0"),
        4 => array ("0","0","0","0","0"),
        5 => array ("0","0","0","0","0")
        );

print_r($arr);
echo "<br>\n\n<br>\n\n";
$str = serialize($arr);
echo "serialized<br>\n", $str, "<br><br>\n\n";

function hex2bin($data) {
    $len = strlen($data);
    return pack("H" . $len, $data);
}

$enc = urlencode($str);
echo "urlencoded<br>", $enc, "<br><br>\n\n";
$gzd = gzcompress($enc);
//echo "gzcompressed (urlencoded)<br>", $gzd, "<br><br>\n\n";
$b64 = base64_encode($gzd);
echo "base64_encoded<br>", $b64, "<br><br>\n\n";
$b2h = bin2hex($enc);
echo "bin2hex (urlencoded)<br>", $b2h, "<br><br>\n\n";
$binary = base_convert($b2h, 16, 2);
echo $binary, "<br><br>\n\n";
$conv = base_convert($binary, 2, 16);
echo $conv, "<br><br>\n\n";
$h2b = hex2bin($conv);
echo $h2b, "<br><br>\n\n";
$md = md5($str);
echo "md5<br>", $md, "<br><br>\n";

?>


------------------------------------------------------------------------



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


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to