protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

Integer overflow at writeStringNoTag

Open yzfeng2020 opened this issue 7 months ago • 1 comments

What version of protobuf and what language are you using? Version: main Language: Java

What operating system (Linux, Windows, ...) and version?

What runtime / compiler are you using (e.g., python version or gcc version)

What did you do? maxLength can overflow if the value is large enough ( Int.Max / 3, around 700MiB) https://github.com/protocolbuffers/protobuf/blame/9e5b1abc82299eb9e962b321d66e12815fbf0a91/java/core/src/main/java/com/google/protobuf/CodedOutputStream.java#L1469

this effectively makes any string larger than 700MiB not able to be written to stream and get OutOfSpaceException. What did you expect to see

What did you see instead?

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).

Anything else we should know about your project / environment

yzfeng2020 avatar Jun 04 '25 22:06 yzfeng2020

cc @shaod2 @zhangskz

honglooker avatar Jun 05 '25 14:06 honglooker

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago. This issue will be closed and archived after 14 additional days without activity.

github-actions[bot] avatar Sep 04 '25 16:09 github-actions[bot]

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.

This issue was closed and archived because there has been no new activity in the 14 days since the inactive label was added.

github-actions[bot] avatar Sep 19 '25 10:09 github-actions[bot]