From 3953b489714ee5eaf329894256e7fa56a7698d6b Mon Sep 17 00:00:00 2001 From: Inaam Rana Date: Wed, 21 Dec 2011 21:33:13 -0500 Subject: [PATCH] Bug#11866367 FPE WHEN SETTING INNODB_SPIN_WAIT_DELAY rb://865 approved by: Jimmy Integer overflow causes division by zero. --- storage/innobase/include/ut0rnd.ic | 2 +- storage/innodb_plugin/include/ut0rnd.ic | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/innobase/include/ut0rnd.ic b/storage/innobase/include/ut0rnd.ic index dc4c0d62f56..b54f629de37 100644 --- a/storage/innobase/include/ut0rnd.ic +++ b/storage/innobase/include/ut0rnd.ic @@ -96,7 +96,7 @@ ut_rnd_interval( rnd = ut_rnd_gen_ulint(); - return(low + (rnd % (high - low + 1))); + return(low + (rnd % (high - low))); } /************************************************************* diff --git a/storage/innodb_plugin/include/ut0rnd.ic b/storage/innodb_plugin/include/ut0rnd.ic index a33813037ea..3ae12f69186 100644 --- a/storage/innodb_plugin/include/ut0rnd.ic +++ b/storage/innodb_plugin/include/ut0rnd.ic @@ -114,7 +114,7 @@ ut_rnd_interval( rnd = ut_rnd_gen_ulint(); - return(low + (rnd % (high - low + 1))); + return(low + (rnd % (high - low))); } /*********************************************************//**