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: null-terminate versionSubstring in OGLGetDriverVersion #860

Merged
merged 1 commit into from
Nov 3, 2024

Conversation

En-En-Code
Copy link
Contributor

Found with Valgrind while cleaning up the Linux cheat menu code.

The length calculated for versionSubstring is the number of bytes in the substring, but that did not account for the null terminator necessary when putting the data in its own string allocation. Thus, the sscanf call could read outsize the allocation bound.

The fix is very simple: provide the extra byte necessary to store a null terminator and do so.

@zeromus zeromus merged commit f51e19b into TASEmulators:master Nov 3, 2024
9 checks passed
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