Skip to content

Commit 757296c

Browse files
authored
Fix size overflow in AbstractDiskHttpData (#15463)
Motivation: The local variable `written` is int in `AbstractDiskHttpData#setContent(InputStream)`, if the inputstream size is larger than max value of int, it will overflow, as a result the `size` will be wrong Modification: make `written` long Result: `size` does not overflow Signed-off-by: 秦利斌 <[email protected]>
1 parent ab3aa88 commit 757296c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public void setContent(InputStream inputStream) throws IOException {
228228
}
229229
file = tempFile();
230230
RandomAccessFile accessFile = new RandomAccessFile(file, "rw");
231-
int written = 0;
231+
long written = 0;
232232
try {
233233
accessFile.setLength(0);
234234
FileChannel localfileChannel = accessFile.getChannel();

0 commit comments

Comments
 (0)