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

IOFile: avoid clearing errors on null file struct #12575

Merged
merged 1 commit into from Feb 13, 2024

Conversation

n8pjl
Copy link
Contributor

@n8pjl n8pjl commented Feb 12, 2024

When performing a default compilation with recent GCC & glibc, the use of -Werror=nonnull causes a build error.

The error is given as IOFile::ClearError() can call std::clearerr() with a null file, which can trigger a null-pointer dereference in libc.

Change the std::clearerr() call to be conditional on a file being open.

When performing a default compilation with recent GCC & glibc,
the use of -Werror=nonnull causes a build error.

The error is given as IOFile::ClearError() can call std::clearerr()
with a null file, which can trigger a null-pointer dereference in libc.

Change the std::clearerr() call to be conditional on a file being open.
@lioncash lioncash merged commit a583526 into dolphin-emu:master Feb 13, 2024
11 checks passed
@n8pjl n8pjl deleted the werror-nonnull branch February 13, 2024 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants