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

Android: Translate C++ "w" to ParcelFileDescriptor "wt" #11670

Merged
merged 1 commit into from Mar 18, 2023

Conversation

JosJuice
Copy link
Member

Previously we were translating "w" to "w", which unlike in C++ doesn't truncate. See https://issuetracker.google.com/issues/180526528, and for reference, https://en.cppreference.com/w/cpp/io/c/fopen and https://en.cppreference.com/w/cpp/io/basic_filebuf/open.

This issue was brought to my attention by the recently published issue CVE-2023-21036 in the screenshot editing tool on Pixel phones. I'm not aware of any code in Dolphin that actually uses "w" with an existing file on Android (when we ask the user for a location to save to using SAF, a new file is always created), but still, best to fix this.

Previously we were translating "w" to "w", which unlike in C++ doesn't
truncate. See https://issuetracker.google.com/issues/180526528, and for
reference, https://en.cppreference.com/w/cpp/io/c/fopen and
https://en.cppreference.com/w/cpp/io/basic_filebuf/open.

This issue was brought to my attention by the recently published issue
CVE-2023-21036 in the screenshot editing tool on Pixel phones. I'm not
aware of any code in Dolphin that actually uses "w" with an existing
file on Android (when we ask the user for a location to save to using
SAF, a new file is always created), but still, best to fix this.
@delroth delroth merged commit 04915d6 into dolphin-emu:master Mar 18, 2023
14 checks passed
@JosJuice JosJuice deleted the android-open-mode branch March 18, 2023 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants