This is an automated email from the ASF dual-hosted git repository.

markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 76f2eea085 Fix possible overflow
76f2eea085 is described below

commit 76f2eea085206556117fc7b1360c3c928007168d
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Oct 14 08:11:54 2026 +0100

    Fix possible overflow
---
 java/org/apache/catalina/session/ManagerBase.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/session/ManagerBase.java 
b/java/org/apache/catalina/session/ManagerBase.java
index a9fbe62baf..10fe2b9b34 100644
--- a/java/org/apache/catalina/session/ManagerBase.java
+++ b/java/org/apache/catalina/session/ManagerBase.java
@@ -776,7 +776,7 @@ public abstract class ManagerBase extends 
LifecycleMBeanBase implements Manager
         // the manager because it is being persisted - update the expired stats
         if (update) {
             long timeNow = System.currentTimeMillis();
-            int timeAlive = (int) (timeNow - 
session.getCreationTimeInternal()) / 1000;
+            int timeAlive = (int) ((timeNow - 
session.getCreationTimeInternal()) / 1000L);
             updateSessionMaxAliveTime(timeAlive);
             expiredSessions.incrementAndGet();
             SessionTiming timing = new SessionTiming(timeNow, timeAlive);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to