Skip to content

Commit e373d47

Browse files
thibaultmeyerrbygrave
authored andcommitted
Potential overflow in int multiplication (#24)
Potential overflow in int multiplication before it is convert to long by use in an assignment context. An integer multiplication that is assigned to a variable of type long or returned from a method with return type long may cause unexpected arithmetic overflow. Signed-off-by: Thibault Meyer <meyer.thibault@gmail.com>
1 parent 60a5224 commit e373d47

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/io/ebean/datasource/pool/ConnectionPool.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public ConnectionPool(String name, DataSourceConfig params) {
203203
this.transactionIsolation = params.getIsolationLevel();
204204

205205
this.maxInactiveMillis = 1000 * params.getMaxInactiveTimeSecs();
206-
this.maxAgeMillis = 60000 * params.getMaxAgeMinutes();
206+
this.maxAgeMillis = 60000L * params.getMaxAgeMinutes();
207207
this.leakTimeMinutes = params.getLeakTimeMinutes();
208208
this.captureStackTrace = params.isCaptureStackTrace();
209209
this.maxStackTraceSize = params.getMaxStackTraceSize();
@@ -217,7 +217,7 @@ public ConnectionPool(String name, DataSourceConfig params) {
217217
this.heartbeatsql = params.getHeartbeatSql();
218218
this.heartbeatFreqSecs = params.getHeartbeatFreqSecs();
219219
this.heartbeatTimeoutSeconds = params.getHeartbeatTimeoutSeconds();
220-
this.trimPoolFreqMillis = 1000 * params.getTrimPoolFreqSecs();
220+
this.trimPoolFreqMillis = 1000L * params.getTrimPoolFreqSecs();
221221

222222
queue = new PooledConnectionQueue(this);
223223

0 commit comments

Comments
 (0)