HADOOP-6975. Integer overflow in S3InputStream for blocks > 2GB. Contributed by Patrick Kling.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1029867 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas White 2010-11-01 22:25:54 +00:00
parent 6285cbb499
commit 1a865e30ea
2 changed files with 4 additions and 1 deletions

View File

@ -292,6 +292,9 @@ Trunk (unreleased changes)
HADOOP-7011. Fix KerberosName.main() to not throw an NPE. HADOOP-7011. Fix KerberosName.main() to not throw an NPE.
(Aaron T. Myers via tomwhite) (Aaron T. Myers via tomwhite)
HADOOP-6975. Integer overflow in S3InputStream for blocks > 2GB.
(Patrick Kling via tomwhite)
Release 0.21.1 - Unreleased Release 0.21.1 - Unreleased
IMPROVEMENTS IMPROVEMENTS

View File

@ -128,7 +128,7 @@ class S3InputStream extends FSInputStream {
if (pos > blockEnd) { if (pos > blockEnd) {
blockSeekTo(pos); blockSeekTo(pos);
} }
int realLen = Math.min(len, (int) (blockEnd - pos + 1)); int realLen = (int) Math.min((long) len, (blockEnd - pos + 1L));
int result = blockStream.read(buf, off, realLen); int result = blockStream.read(buf, off, realLen);
if (result >= 0) { if (result >= 0) {
pos += result; pos += result;