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 allocation size overflow check in CowData #81917

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

AThousandShips
Copy link
Member

@AThousandShips AThousandShips commented Sep 19, 2023

For large input data, the next power of two check can return 0, causing the allocation size to not be valid, this ensures that it fails if that is the case.

Will look into adding error checks to code that uses resize on things and then depends on it being successful, but taking that in a separate PR

@AThousandShips AThousandShips added bug topic:core crash cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release labels Sep 19, 2023
@AThousandShips AThousandShips added this to the 4.2 milestone Sep 19, 2023
@AThousandShips AThousandShips requested a review from a team as a code owner September 19, 2023 12:06
@AThousandShips AThousandShips changed the title Fix minimal overflow check in CowData Fix allocation size overflow check in CowData Sep 19, 2023
@akien-mga akien-mga merged commit c36f6f8 into godotengine:master Sep 20, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@AThousandShips AThousandShips deleted the alloc_fix branch September 20, 2023 11:14
@AThousandShips
Copy link
Member Author

Thank you!

@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No nullptr check in cowdata - crash to desktop
4 participants