Bug #54598 [Ana->Csd]: bcpowmod() may return 1 if modulus is 1

From: Date: Wed, 06 Sep 2017 22:50:38 +0000
Subject: Bug #54598 [Ana->Csd]: bcpowmod() may return 1 if modulus is 1
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210979@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=54598&edit=1 ID: 54598 Updated by: cmb@php.net Reported by: okano1220 at gmail dot com Summary: bcpowmod() may return 1 if modulus is 1 -Status: Analyzed +Status: Closed Type: Bug Package: BC math related Operating System: linux,windows PHP Version: 5.3.6 Assigned To: cmb Block user comment: N Private report: N New Comment: Automatic comment on behalf of cmbecker69@gmx.de Revision: http://git.php.net/?p=php-src.git;a=commit;h=b2919853f867ca7948e1c80c48eb868eae4ba882 Log: Fixed bug #54598 (bcpowmod() may return 1 if modulus is 1) Previous Comments: ------------------------------------------------------------------------ [2017-09-06 22:06:19] cmb@php.net Thanks for reporting this issue and providing an appropriate patch! And sorry for the long delay! ------------------------------------------------------------------------ [2011-04-24 16:15:50] okano1220 at gmail dot com Description: ------------ when setting bcpowmod 2nd parameter $right_operand to 0 and setting 3rd parameter $modulous to 1, bcpowmod returns 1. Ofcourse expected value is 0. Test script: --------------- <?php echo bcpomod(5,0,1); // 5**0%1 Expected result: ---------------- 0 Actual result: -------------- 1 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=54598&edit=1

« previous php.bugs (#210979) next »