Skip to content

Fix size overflow in AbstractDiskHttpData#15463

Merged
chrisvest merged 1 commit intonetty:4.2from
qchole:disk-http-data-size-fix
Jul 11, 2025
Merged

Fix size overflow in AbstractDiskHttpData#15463
chrisvest merged 1 commit intonetty:4.2from
qchole:disk-http-data-size-fix

Conversation

@qchole
Copy link
Copy Markdown
Contributor

@qchole qchole commented Jul 10, 2025

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: 秦利斌 <68638598+Allan-QLB@users.noreply.github.com>
@chrisvest chrisvest merged commit 757296c into netty:4.2 Jul 11, 2025
18 checks passed
@chrisvest
Copy link
Copy Markdown
Member

Thanks!

@chrisvest chrisvest added this to the 4.2.3.Final milestone Jul 11, 2025
chrisvest pushed a commit to chrisvest/netty that referenced this pull request Jul 11, 2025
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: 秦利斌 <68638598+Allan-QLB@users.noreply.github.com>
chrisvest added a commit that referenced this pull request Jul 11, 2025
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: 秦利斌 <68638598+Allan-QLB@users.noreply.github.com>
Co-authored-by: 秦利斌 <68638598+Allan-QLB@users.noreply.github.com>
@qchole qchole deleted the disk-http-data-size-fix branch July 12, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants