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 addon MD5 buffer overflow #3196

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tulpenkiste
Copy link
Contributor

@tulpenkiste tulpenkiste commented Jan 30, 2025

The original code was using sizeof(so) which, on my machine, is returning 8. This causes the game to try to write to a point past so[32], causing a buffer overflow.
This PR simply hardcodes the size to 3 (as each char is always 1 byte large, theres 2 chars inserted via the format + 1 NULL char). This makes it not buffer overflow without breaking existing addon functionality.

@MatusGuy
Copy link
Member

Is this a duplicate of #3136?

@tulpenkiste
Copy link
Contributor Author

Ah, looks like it is, although Semphriss's explanation is wrong

@swagtoy
Copy link
Contributor

swagtoy commented Jan 30, 2025

This is indeed a duplicate, and I complained about our MD5 code before. But for now, if we want to fix this issue, we can just merge this. Semphris' code has an issue with the comments and he hasn't responded. I don't personally care about refactoring right now if this is an issue.

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.

3 participants