Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Int overflow in BodyParsers.anyContent(maxLength: Option[Long]) #10741

Merged
merged 1 commit into from Mar 10, 2021

Conversation

xuwei-k
Copy link
Contributor

@xuwei-k xuwei-k commented Mar 5, 2021

Pull Request Checklist

Helpful things

Fixes

fix Int overflow. please see test case

Purpose

Background Context

References

use Long since #8627

Comment on lines +921 to 922
def maxLengthOrDefault = maxLength.getOrElse(DefaultMaxTextLength)
def maxLengthOrDefaultLarge = maxLength.getOrElse(DefaultMaxDiskLength)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know the reason there are maxLengthOrDefault and maxLengthOrDefaultLarge both. 🤔
Should we remove either one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like maxLengthOrDefault is the maximum for a body stored in memory, whereas maxLengthOrDefaultLarge is the maximum for a body stored on disk. Perhaps they could be renamed to:

def maxMemoryLength = maxLength.getOrElse(DefaultMaxTextLength)
def maxDiskLength = maxLength.getOrElse(DefaultMaxDiskLength)

@mkurz mkurz added this to the 2.8.8 milestone Mar 5, 2021
@mkurz
Copy link
Member

mkurz commented Mar 10, 2021

@Mergifyio backport 2.8.x

@mergify
Copy link
Contributor

mergify bot commented Mar 10, 2021

Command backport 2.8.x: pending

Waiting for the pull request to get merged

@mergify mergify bot merged commit 47f277b into playframework:master Mar 10, 2021
@xuwei-k xuwei-k deleted the anyContent-Int-overflow branch March 10, 2021 10:23
@mergify
Copy link
Contributor

mergify bot commented Mar 10, 2021

Command backport 2.8.x: success

Backports have been created

mergify bot added a commit that referenced this pull request Mar 10, 2021
fix Int overflow in BodyParsers.anyContent(maxLength: Option[Long]) (bp #10741)
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.

None yet

3 participants