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 crash when ArrayList runs out of memory #1233 #1235

Merged
merged 2 commits into from
Apr 30, 2020

Conversation

peace-maker
Copy link
Member

The allocation size was still updated to the bigger size even if memory allocation failed. Trying to write to the supposedly available new space would overflow the heap and crash.

The allocation size was still updated to the bigger size even if memory allocation failed. Trying to write to the supposedly available new space would overflow the heap and crash.
core/logic/CellArray.h Outdated Show resolved Hide resolved
@peace-maker
Copy link
Member Author

Good points, I've included the overflow checks from ke::Vector.

@asherkin asherkin linked an issue Apr 30, 2020 that may be closed by this pull request
@asherkin asherkin merged commit 5597fc5 into alliedmodders:master Apr 30, 2020
@peace-maker peace-maker deleted the cellarray_oom branch April 30, 2020 17:32
asherkin pushed a commit that referenced this pull request Apr 30, 2020
The allocation size was still updated to the bigger size even if memory allocation failed. Trying to write to the supposedly available new space would overflow the heap and crash. Fixes #1233
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.

m_AllocSize corrupted on allocation failure
3 participants