Skip to content

Fix crash when ArrayList runs out of memory #1233#1235

Merged
asherkin merged 2 commits intoalliedmodders:masterfrom
peace-maker:cellarray_oom
Apr 30, 2020
Merged

Fix crash when ArrayList runs out of memory #1233#1235
asherkin merged 2 commits intoalliedmodders:masterfrom
peace-maker:cellarray_oom

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.
@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