Skip to content

Commit a3e6421

Browse files
gculikslandelle
authored andcommitted
Fixed integer overflow when file size > Integer.MAX_INT, close AsyncHttpClient#1342
Motivation: `FilePart` currently uses an int to track written length. Huge files can cause an overflow. Modification: Use a long instead of an int Result: No more overflow
1 parent 1f678c4 commit a3e6421

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/ning/http/client/multipart/FilePart.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public long write(WritableByteChannel target, byte[] boundary) throws IOExceptio
101101

102102
handler.start();
103103

104-
int length = 0;
104+
long length = 0;
105105

106106
length += MultipartUtils.writeBytesToChannel(target, generateFileStart(boundary));
107107

0 commit comments

Comments
 (0)