Skip to content

Commit 5d730f1

Browse files
authored
Merge pull request #545 from YangSen-qn/master
fix file source read memory overflow
2 parents a98089c + 9867128 commit 5d730f1

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Changelog
2+
## 7.9.4 (2022-01-27)
3+
### 对象存储
4+
* 修复大于 2G 的文件上传读取分片信息时数据溢出问题
5+
* 接口全面支持 Qiniu 签名
26

37
## 7.9.3 (2022-01-27)
48
### 对象存储

src/main/java/com/qiniu/common/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public final class Constants {
99
/**
1010
* 版本号
1111
*/
12-
public static final String VERSION = "7.9.3";
12+
public static final String VERSION = "7.9.4";
1313
/**
1414
* 块大小,不能改变
1515
*/

src/main/java/com/qiniu/storage/ResumeUploadSourceFile.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ private void createBlockList(Configuration config, long fileSize, int blockSize)
2828
long offset = 0;
2929
int blockIndex = 0;
3030
while (offset < fileSize) {
31-
int lastSize = (int) (fileSize - offset);
32-
int blockSizeP = Math.min(lastSize, blockSize);
33-
Block block = new Block(config, offset, blockSizeP, blockIndex);
31+
long lastSize = fileSize - offset;
32+
long blockSizeP = Math.min(lastSize, (long)blockSize);
33+
Block block = new Block(config, offset, (int)blockSizeP, blockIndex);
3434
blockList.add(block);
3535
offset += blockSizeP;
3636
blockIndex += 1;

0 commit comments

Comments
 (0)