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 malloc, calloc and realloc #3

Closed
wants to merge 1 commit into from

Conversation

powware
Copy link

@powware powware commented Jul 1, 2022

calloc and realloc only track the size that has been requested by the user, when realloc then forwards the size to ReallocatePool the sizeof(size_t) is missing and the memcopy of ReallocatePool misses these bytes.

Addtionally calloc only tracks the size parameter where it should instead track the product of nmemb and size.

I rewrote malloc, calloc and realloc to track the true size in memory for easier handling.

@pbatard
Copy link
Owner

pbatard commented Oct 31, 2022

Good call! Sorry for the delay in replying to your PR, as I must admit it fell through my list of notifications.

I'll be updating this project in the coming days, due to the release of 2022.10.3 upstream, and I'll make sure to integrate your changes. Thanks again!

@pbatard pbatard self-assigned this Oct 31, 2022
@pbatard pbatard closed this in aedfef8 Nov 2, 2022
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.

2 participants