diff --git a/src/java/org/apache/hadoop/mapred/IFile.java b/src/java/org/apache/hadoop/mapred/IFile.java index 57e74df8..c53266dd 100644 --- a/src/java/org/apache/hadoop/mapred/IFile.java +++ b/src/java/org/apache/hadoop/mapred/IFile.java @@ -424,7 +424,11 @@ public boolean nextRawKey(DataInputBuffer key) throws IOException { return false; } if (keyBytes.length < currentKeyLength) { - keyBytes = new byte[currentKeyLength << 1]; + if (currentKeyLength << 1 < 0) { + keyBytes = new byte[Integer.MAX_VALUE]; + } else { + keyBytes = new byte[currentKeyLength << 1]; + } } int i = readData(keyBytes, 0, currentKeyLength); if (i != currentKeyLength) {