8252100: NumberOverflow in class MemoryCache

Reviewed-by: prr, serb
This commit is contained in:
Jayathirth D V 2020-09-17 04:31:11 +00:00
parent 9a7dcdcdba
commit b87a159967

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -333,7 +333,7 @@ class MemoryCache {
}
long index = pos/BUFFER_LENGTH;
int offset = (int)pos % BUFFER_LENGTH;
int offset = (int)(pos % BUFFER_LENGTH);
while (len > 0) {
int nbytes = Math.min(len, BUFFER_LENGTH - offset);
byte[] buf = getCacheBlock(index++);