8252100: NumberOverflow in class MemoryCache
Reviewed-by: prr, serb
This commit is contained in:
parent
9a7dcdcdba
commit
b87a159967
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -333,7 +333,7 @@ class MemoryCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
long index = pos/BUFFER_LENGTH;
|
long index = pos/BUFFER_LENGTH;
|
||||||
int offset = (int)pos % BUFFER_LENGTH;
|
int offset = (int)(pos % BUFFER_LENGTH);
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
int nbytes = Math.min(len, BUFFER_LENGTH - offset);
|
int nbytes = Math.min(len, BUFFER_LENGTH - offset);
|
||||||
byte[] buf = getCacheBlock(index++);
|
byte[] buf = getCacheBlock(index++);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user