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

MMKVPMarshaller heap corruption #652

Open
Aphemuru opened this issue Nov 8, 2024 · 0 comments
Open

MMKVPMarshaller heap corruption #652

Aphemuru opened this issue Nov 8, 2024 · 0 comments

Comments

@Aphemuru
Copy link

Aphemuru commented Nov 8, 2024

If you pass an empty size MatchMakingKeyValuePair_t[] array (instead of null) to any of the RequestXYZList methods in SteamMatchmakingServers, it will cause heap corruption.

Why: it will allocate a zero-size block of memory using Marshal.AllocHGlobal. I'm sure the actual returned size isn't zero, because it returns a valid pointer, but the problem is it writes 8 bytes onto this. When it gets freed it causes a heap corruption error.

image

Solution: Simply check if the array is empty, and do not allocate anything if that's the case.

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

No branches or pull requests

1 participant