#51105 [Fbk]: PHP str_repeat() Function Integer Overflow

From: Date: Sun, 21 Feb 2010 17:26:54 +0000
Subject: #51105 [Fbk]: PHP str_repeat() Function Integer Overflow
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-147927@lists.php.net to get a copy of this message
ID: 51105 Updated by: pajoye@php.net Reported By: r3d dot w0rm at yahoo dot com Status: Feedback Bug Type: Strings related Operating System: All PHP Version: 5.3.2RC2 New Comment: Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php for *NIX and http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32 Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2010-02-21 16:33:01] r3d dot w0rm at yahoo dot com Os : win Xp Sp 2 , Fedora 11 Cpu : 2.2 ------------------------------------------------------------------------ [2010-02-21 15:14:28] pajoye@php.net Which processor and OS do you use? I get the expected fatal error here. ------------------------------------------------------------------------ [2010-02-21 14:44:34] r3d dot w0rm at yahoo dot com Description: ------------ PHP str_repeat() Function Integer Overflow AUTHOR : Sina Yazdanmehr(R3d.W0rm) Discovered by : Sina Yazdanmehr (R3d.W0rm) Our Site : http://IrCrash.com Our Forums : http://ircrash.com/persian/ My Official WebSite : http://R3dW0rm.ir IRCRASH Team Members : Khashayar Fereidani - R3d.w0rm (Sina Yazdanmehr) Reproduce code: --------------- <?php //www.IrCrash.com //By : R3d.W0rm $str1 = str_repeat('0x0x0x0x',999999999); $str2 = str_repeat($str,1); ?> Expected result: ---------------- Fatal error: Possible integer overflow in memory allocation (8 * 999999999 + 1) in F:\Program Files\EasyPHP-5.3.1\www\over.php on line 4 Fatal error: Possible integer overflow in memory allocation (8 * 999999999 + 1) in /var/www/html/over.php on line 4 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=51105&edit=1

« previous php.bugs (#147927) next »