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

Plug memory leak that happens upon error. #155

Merged
merged 1 commit into from
Feb 12, 2024
Merged

Conversation

sebras
Copy link
Contributor

@sebras sebras commented Feb 12, 2024

If fgStructure.CurrentMenu is set when glutAddMenuEntry() or glutAddSubMenu() is called the allocated menuEntry variable will leak. This commit postpones allocating menuEntry until after the error checks, thereby plugging the memory leak.

This fixes CVE-2024-24258 and CVE-2024-24259.

If fgStructure.CurrentMenu is set when glutAddMenuEntry() or
glutAddSubMenu() is called the allocated menuEntry variable will
leak. This commit postpones allocating menuEntry until after the
error checks, thereby plugging the memory leak.

This fixes CVE-2024-24258 and CVE-2024-24259.
@sebras
Copy link
Contributor Author

sebras commented Feb 12, 2024

I don't know why these CVEs were filed against MuPDF instead of freeglut, and I doubt that these should be of high severity. Anyway, here is my proposed fix. Please let me know if you want me to change it some how.

@jtsiomb
Copy link
Member

jtsiomb commented Feb 12, 2024

Thanks! I've no idea how a memory leak can be classified as a "vulnerability", but nevertheless, it's good to not have any :)

@jtsiomb jtsiomb merged commit 9ad320c into freeglut:master Feb 12, 2024
6 checks passed
@sebras
Copy link
Contributor Author

sebras commented Feb 12, 2024

Me neither, but thank you for a speedy merge. :)

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.

None yet

2 participants