Bug #14807 Updated: base_convert() crashes with > 1500 digits

From: Date: Tue, 18 Jun 2002 00:04:51 +0000
Subject: Bug #14807 Updated: base_convert() crashes with > 1500 digits
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-10977@lists.php.net to get a copy of this message
ID: 14807 Updated by: edink@php.net Reported By: amnuts@talker.com -Status: Analyzed +Status: Closed Bug Type: Reproducible crash Operating System: Linux PHP Version: 4.3.0-dev New Comment: This bug has been fixed in CVS. You can grab a snapshot of the CVS version at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2002-06-17 19:13:47] sniper@php.net Reproduced with latest CVS HEAD. ------------------------------------------------------------------------ [2002-03-30 13:44:04] mss@medecom.com Another test case which makes base_convert dump core is this: <?php $x=base_convert ("2f0f336509c9a3d0f29e4281321d496f", 16, 36); echo $x; echo Done; ?> I have not experienced this problem under SuSE 7.2 but under the following: Mandrake 8.2 Linux p700 2.4.18-6mdk #1 Fri Mar 15 02:59:08 CET 2002 i686 unknown apache-1.3.23-4mdk apache-common-1.3.23-4mdk apache-modules-1.3.23-4mdk mod_php-4.1.2-1mdk php-4.1.2-1mdk php-common-4.1.2-1mdk ------------------------------------------------------------------------ [2002-01-03 03:43:07] thies@php.net 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) ------------------------------------------------------------------------ [2002-01-02 14:11:15] amnuts@talker.com 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] jan@php.net 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.) ? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/14807 -- Edit this bug report at http://bugs.php.net/?id=14807&edit=1

« previous php.bugs (#10977) next »