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 memory corruption caused by swprintf #41

Merged
merged 1 commit into from May 16, 2024
Merged

Fix memory corruption caused by swprintf #41

merged 1 commit into from May 16, 2024

Conversation

ghost
Copy link

@ghost ghost commented May 16, 2024

swprintf requires a destination buffer size like snprintf. This was previously only working by chance because of how MSVC emits variadic functions.

swprintf also automatically appends a null terminator to the output string so there's no reason to add it via the format string.

This was leading to a buffer overflow and occasional heap corruption.

swprintf requires a destination buffer size like snprintf. This was
previously only working by chance because of how MSVC emits variadic
functions.

swprintf also automatically appends a null terminator to the output
string so there's no reason to add it via the format string.

This was leading to a buffer overflow and occasional heap corruption.
@Wassimulator Wassimulator merged commit 8beec45 into Wassimulator:master-2.0 May 16, 2024
@Wassimulator
Copy link
Owner

I've been chasing this. thanks!

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.

1 participant