https://issues.apache.org/bugzilla/show_bug.cgi?id=47705
authorfunkman <funkman@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 31 Aug 2009 14:17:37 +0000 (14:17 +0000)
committerfunkman <funkman@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 31 Aug 2009 14:17:37 +0000 (14:17 +0000)
ArithmeticException: / by zero when expiring sessions via manager

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@809603 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/manager/ManagerServlet.java

index 665568e..ba6737c 100644 (file)
@@ -1106,6 +1106,8 @@ public class ManagerServlet
             int histoInterval = maxInactiveInterval / maxCount;
             if ( histoInterval * maxCount < maxInactiveInterval ) 
                 histoInterval++;
+            if (0==histoInterval)
+                histoInterval=1;
             maxCount = maxInactiveInterval / histoInterval;
             if ( histoInterval * maxCount < maxInactiveInterval ) 
                 maxCount++;